SD cards File read problems

For general Flowcode discussion that does not belong in the other sections.
Post Reply
User avatar
p.erasmus
Posts: 434
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

SD cards File read problems

Post by p.erasmus »

Hi Team,

I need help in understanding the way to read a text file saved on a SD Card.

The text file consists of 20 Voltage values from AN0 and the values are the converted to strings Float values of the voltage not the bit value,
example 1.85 ,2.56.4.9. etc
as shown here from the Console buffer when I open the file to read it ,as you can see the string in green ,the coma separator in purple(0x2C) and then there is a value 0x20 which seems to be a space ,I do not know why is this (I am using the write string to file function in code).

P2.jpg
P2.jpg (116.13 KiB) Viewed 2559 times

Now the problem I am having (also not sure how to do this) when reading the file with the stringRead function the first string is returned correctly then the comma is returend and then again the correct string is returned , there is always a miss read between the strings ,

any advise how to work with this SD card reads I will appreciate I have no clue what I am doing :oops:

P3.jpg
P3.jpg (17.17 KiB) Viewed 2559 times
Regards Peter - QME Electronics

BenR
Matrix Staff
Posts: 1760
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 447 times
Been thanked: 607 times

Re: SD cards File read problems

Post by BenR »

Hello Peter,

Is it possible to post a simple example that shows the problem and I'll investigate what might be going wrong for you.

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: SD cards File read problems

Post by p.erasmus »

Hi Ben

Thanks for your offer,I will make a small project with only this part from main application code.I am sure it is me not understanding how the SD card is populated with the data and how to retrieve it correctly your help will be appreciated :D
Regards Peter - QME Electronics

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: SD cards File read problems

Post by p.erasmus »

Hi Ben,

Attached a simple read of 6 vales from the file starting at the first value,
you will noticed the first value is correct then it read only the comma(2C) then again a value and so on .

I know it is me doing somethings wrong because of limited knowledge of the SD cards :oops: also please help me understand in the console it shows the file length is 120 bytes when I read the length in the code it shows 512 Why ?

P1.jpg
P1.jpg (13.86 KiB) Viewed 2516 times

SD_file_Read_Test.rar
(9.47 KiB) Downloaded 163 times

Thanks a million for helping out
:D
Regards Peter - QME Electronics

Post Reply