Write to start of sd card file

For general Flowcode discussion that does not belong in the other sections.
BenR
Matrix Staff
Posts: 1707
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Write to start of sd card file

Post by BenR »

Please can you post your latest version of the project and I'll investigate for you.

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Write to start of sd card file

Post by WingNut »

Ben I've just PM'd you the full file with most of it toggled off. Hopefully you can figure this out

I should add the file needs created first. The default few bytes at the start of the file are 100601111

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Write to start of sd card file

Post by WingNut »

Just noticed that the message i last posted hasnt appeared. Ben I pm'd my flowcode file.
The file already exists and has data, but as stated above it won't simulate above 5hz

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Write to start of sd card file

Post by BenR »

Hello,

As a quick test I wrote this and it seems to be working fine at full sim speed.

Test.txt
(513 Bytes) Downloaded 41 times
FileTest.fcfx
(11.47 KiB) Downloaded 42 times

I wonder if the problem your seeing is that you are opening and closing the file several times during the program.

I've just made a change to the FAT component to try and push any pending changes when closing the file, the sim relies on Windows to do file read/writes in the background and so when closing and reopening at fast speed there could have been a problem. Hopefully this will make a difference.

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Write to start of sd card file

Post by WingNut »

Thanks Ben. I gave it a try after updating the component. If anything its worse as I can get it to save to file at 5hz any more
Im using windows 11 if that makes any difference. The open and closing of the file only occurs if the rest of the program is toggled on

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Write to start of sd card file

Post by WingNut »

I cant get your flowcode to work either

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Write to start of sd card file

Post by BenR »

Hello,

Are you using a local drive? I've got the file and Flowcode project on a SSD so I'll try on a HDD too and check that is ok.

I don't currently have Windows 11 available to test but I wouldn't have thought that would cause issues.

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Write to start of sd card file

Post by WingNut »

yes I'm using my local c: drive which is an ssd

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Write to start of sd card file

Post by BenR »

This is interesting.
https://www.theregister.com/2021/12/08/ ... slow_nvme/

Do you have another local drive you could try?

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Write to start of sd card file

Post by WingNut »

Not on that machine Ben. After some mucking around i think I've found another related issue. Martin fisher uploaded a file to test which finishes up in the download folder. When double clicking to open the file it seems to have changed the root directory to the download directory. The program therefore couldn't find the txt file to write to. Moving the test.txt file into the download folder and filetest now works yet the root directory : $(srcdir) says the same so somehow some environment variable has changed inadvertently

Post Reply