Setfileindex0 and 1

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Setfileindex0 and 1

Post by mikn »

I am trying to read string from file1 and save it to file2 using SetFileIndex(0) and (1)
But I get read strings from File2 and added to same File2 at the end.

What may be wrong?
Code screenshot included.
Attachments
sc-file12.GIF
sc-file12.GIF (7.09 KiB) Viewed 7609 times
FC 6.1.3.2 (18.02.2016)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Setfileindex0 and 1

Post by Benj »

Hello,

That looks correct to me. I'll have a go here and see if I can find out what the problem is.

Thinking about it you will probably need to call the ReadFileSector function each time after you set the file index. Otherwise the shared sector buffer will likely be getting corrupted.

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

same. here's the file2.txt result after the cycle
sc-readstr.GIF
sc-readstr.GIF (4.85 KiB) Viewed 7593 times
FC 6.1.3.2 (18.02.2016)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Setfileindex0 and 1

Post by Benj »

Ok thanks, I'll set this up tomorrow morning and see if I can get it to work correctly.

Is the problem your seeing on hardware or using the simulation or both?

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

It's on hardware.

upd:
seems like something is wrong with switching at SetFileIndex. Even when I set wrong index (file1 is 0 and file2 is 1, but i set to 2) it was reading and writting from/to the last opened file. Same confirmed when I've changed the order - opened file2 and then file1. It was reading and writting to file1 only.
FC 6.1.3.2 (18.02.2016)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

any updates?
FC 6.1.3.2 (18.02.2016)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

Wed Oct 01, 2014 1:09 pm
Benj wrote:Ok thanks, I'll set this up tomorrow morning
:(
FC 6.1.3.2 (18.02.2016)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Setfileindex0 and 1

Post by Benj »

Hello,

Right finally it's been quiet in the office and I have been able to spend some time looking into this for you.

I have only tried a single 512 byte sector copy of the test.txt file into test2.txt but it seems to be working correctly for me.
FatTest.fcfx
(6.45 KiB) Downloaded 192 times
Had a couple of issues but then I formatted the card I was using and everything now seems to be working correctly.

Let me know how you get on.

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

This code:
sc-file12append.GIF
sc-file12append.GIF (6.62 KiB) Viewed 7518 times
gives this result:
file1: empty
file2: to file 1to file 2

This code:
sc-file12sec.GIF
sc-file12sec.GIF (5.61 KiB) Viewed 7518 times
gives this result:
file1: testfrom1
file2: \mB`kYЌkph^\b[v~YDcztGlh†sKi2ДўPsj€{яя1D3е:5K™bЂ4rаv‘`“…ѓrЊ[|2sXѕ„W_f]uqflaЌZ‚o[Њej›i•urk][6ѓyfNђnu7ѓhqXo=:Тія4: чpTGxE>5?2яІ©~zУ~hыRСi_qdWwscforПHm~WS][xOmtq=k|bgv`jm„OpZV€wUN—jf_>mt§SOGеRSя3ЧЕяl5˜‚1QK5ђeѓя\бv±˜@ЎupX“d‹gVZ]pok{CЉntK{ete‰c\zSq‰5ЋµS<surxkfX{P6tlП‹›Hђ7БЉ4|Ь…§з4922ўќ4um27Tt®‘oфE™fsw}]YsTe~]^ciYcunntkbTYYђoofџbLSPwajt4‹yiYS–hВеFUгJBMяю‰Ґ6фЎG89?I/‘RЂ~Њv2ЅhЊzny‡|jUUЃ\qnЗIЂtw[wF‡Д_љaen]kkdU~S]c|kaq^ckaRk5gM…lЋд;S6‹›‹ 32>ђ02цiЏS†V˜€1?•†k\ySjzv|N8’ep‚bi@`Џ8Y„Ђi‰J™P
(512 bytes of trash)

ps:
Right finally it's been quiet in the office and I have been able to spend some time looking into this for you.
I really respect your work performance but each time I wonder why you do all the job alone? You do the code, you answer questions and so on. I wonder why you don't involve some more people into the support process?
FC 6.1.3.2 (18.02.2016)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Setfileindex0 and 1

Post by Benj »

I wonder why you don't involve some more people into the support process?
We are a fairly small company with a small dev team which is why we rely on the VC's interacting on the forums and helping with support. I would love to have more help but unless we sell more copies of Flowcode to justify increasing the size of the team I don't see it happening. Also you can't just hire anyone they have to be passionate and skilled otherwise it's just more of a drain on me :D .

The last three or four employee's to be hired at Matrix have all been sales / marketing type people. Even the head of development is now pretty much completely focused on sales and marketing! Maybe the next employment will be for a new dev team member but I think this is doubtful. This is not all bad news as we are now at least managing to come up with ways of selling the new and exciting stuff rather then just sitting on it for a few months and then concluding it has been a failure. However the new ECIO literally has been ready to ship for a year and it's literally taken this long just for me to justify it's existence to my non technical managers. They want something to compete with Arduino but the ECIO doesn't feel right to them?!

Anyway rant over and I'll look into the problem a bit deeper and see if I can find a solution for you.

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

Thanks for the detailed reply, Benj. It's really appreciated because in bigger software companies it's hard to talk to real coders and not just stupid support girls who read internal FAQ and quote it to the client.

With FC I have found a new field where I can realize my professional skills skipping the long way of reading tons of books. I see you produce boards too, but I think the big perspective is to add as more components as you can for each of known devices in the market. With ready components people can construct ready to work devices like LEGO constructor.

As for me I have a good guys who work for me and create hardware parts. I do the code and logic. If you could add more wireless devices, specific sensors and so on, also optimize and speed up the FAT component, ADC component and all other realtime parts, the value of FC will be... invaluable :)

The most annoying things now are bugs and time how long it takes to fix them. That's why I remind about some problems often. I've bought pro version and do commercial product now. And it has some deadline time. I can't go forward sometimes because I stuck on the place and, for example, can't create two files (as with Setfileindex issue).
Think about payable support. 1-2 hours of private chat sometimes is enough to find the problem and move forward and clients won't wait too much if they need support right now. That's the good stimulus to new coder also. :)
FC 6.1.3.2 (18.02.2016)

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Setfileindex0 and 1

Post by kersing »

Matrix offers a service you might want to look into. Quoting from the April edition of the Matrix newsletter:
Professional Services

Over the last few years the number of industrial companies who are now using Flowcode to develop commercial products has risen considerably. We
have been contacted by some companies who need a greater level of support in their development departments. With this in mind we are pleased to
announce the launch of Professional services to meet the growing demand for more tailored support from companies using Flowcode. We now offer three
separate services:

Rapid customer Support provides you with fast response to  your technical queries within targeted guidelines. On submission of an issue we will
take full ownership of your request, keep you up to date with the status of the problem, will prioritise its remedy, and will give you the
assistance you need to rapidly solve your issues, allowing you to keep your projects on track.

Extended Services allows customers the ability to subcontract specific pieces of work within the product development cycle to the appropriate
experts within the Matrix development team. With Extended Services, customers purchase an agreed amount of hours and are able to call off those
hours on a variety of projects under the terms of a service level agreement.

The Accelerator package is designed for new customers to help them get up and running with Flowcode 6 within the shortest possible time. Matrix
staff will take on the work of installing Flowcode software to our best practice recommendation, will train your staff in using Flowcode with a
dedicated course to bring you up to intermediate levels of design capability in just 2 days.

If you’re interested in finding out more about these services, please contact us
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

If you’re interested in finding out more about these services, please contact us
That's what I did with my last message :D
FC 6.1.3.2 (18.02.2016)

User avatar
mikn
Posts: 209
Joined: Mon Mar 03, 2014 10:11 pm
Has thanked: 54 times
Been thanked: 41 times
Contact:

Re: Setfileindex0 and 1

Post by mikn »

I am dumb.

solved by
FAT -> max_concurrent_files -> set to 2, instead of 1.

damn. :( I thought that 1 means +1 concurrent file to already opened.
FC 6.1.3.2 (18.02.2016)

Post Reply