Hi
Is this a Bug or i am doing somthing wrong ? , I have 2 files in the SD Card named
A.txt and B.txt, A.txt contain " This is File A " and B.txt contain " This is File B "
In the flowchart I : INIT CARD -> SetFileIndex(0) -> OpenFile(A.txt) - > SetFileIndex(1) -> OpenFile(B.txt) - > ReadStringFromFile(50,13)
-> SendString via RS232 -> SetFileIndex(0) -> ReadStringFromFile(50,13) -> SendString via RS232
I get the below result :
This is File B
This is File B
FAT Set File INDEX [solved]
Moderator: Benj
- Alan_37
- Posts: 179
- Joined: Sun May 01, 2016 8:36 pm
- Has thanked: 51 times
- Been thanked: 54 times
- Contact:
FAT Set File INDEX [solved]
- Attachments
-
- B.txt
- (45 Bytes) Downloaded 215 times
-
- A.txt
- (47 Bytes) Downloaded 209 times
-
- Flowcode1.fcfx
- (9.79 KiB) Downloaded 217 times
- 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: FAT Set File INDEX
Hi Alan,
I think I see what's going wrong. The buffer is not being reloaded when you change the file index so the data is coming from the FileB buffer.
How about trying this instead.
INIT CARD -> SetFileIndex(0) -> OpenFile(A.txt) - > SetFileIndex(1) -> OpenFile(B.txt) - > ReadStringFromFile(50,13)
-> SendString via RS232 -> SetFileIndex(0) -> ReadFileSector() -> ReadStringFromFile(50,13) -> SendString via RS232
I think I see what's going wrong. The buffer is not being reloaded when you change the file index so the data is coming from the FileB buffer.
How about trying this instead.
INIT CARD -> SetFileIndex(0) -> OpenFile(A.txt) - > SetFileIndex(1) -> OpenFile(B.txt) - > ReadStringFromFile(50,13)
-> SendString via RS232 -> SetFileIndex(0) -> ReadFileSector() -> ReadStringFromFile(50,13) -> SendString via RS232
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Alan_37
- Posts: 179
- Joined: Sun May 01, 2016 8:36 pm
- Has thanked: 51 times
- Been thanked: 54 times
- Contact:
Re: FAT Set File INDEX
Hi Benj
Thanks for your reply
I have added the ReadFileSector() but i am still getting the same result .
Thanks for your reply
I have added the ReadFileSector() but i am still getting the same result .
- Attachments
-
- rs232.png
- (15.49 KiB) Downloaded 2608 times
-
- Flowcode1.fcfx
- (9.96 KiB) Downloaded 226 times
- 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: FAT Set File INDEX
Hi Alan,
In the FAT component properties the Max Concurrent Files property is set to 1, if you change this to 2 does this make any difference?
In the FAT component properties the Max Concurrent Files property is set to 1, if you change this to 2 does this make any difference?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Alan_37
- Posts: 179
- Joined: Sun May 01, 2016 8:36 pm
- Has thanked: 51 times
- Been thanked: 54 times
- Contact:
Re: FAT Set File INDEX
Hi Benj
Yes that was the problem , now it is working fine , i must have missed that setting
can move this to general programming as it was not a bug .
Thanks very much for your support .
Yes that was the problem , now it is working fine , i must have missed that setting
can move this to general programming as it was not a bug .
Thanks very much for your support .
- 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: FAT Set File INDEX
Great news, thanks for letting us know.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel