Comma separated values (CSV) - Into a DAT table
Snyggis
Posts: 14
I am trying to load a comma separated value file into to a DAT table on my propeller chip. I have been trying to use "Variable := Debug.getDec" however this seems to only load one value at a time.
It seems that I have two problems, one is getting the propeller to accept the data in the chunks between the commas, and then putting it into a DAT table.
Does anyone know how this is done, or can direct me to information on this?
Also, does anyone know if hyperterminal, or the parrallax serial terminal, can directly read a CSV file directly, instead of me having to copy and paste?
Thanks!
It seems that I have two problems, one is getting the propeller to accept the data in the chunks between the commas, and then putting it into a DAT table.
Does anyone know how this is done, or can direct me to information on this?
Also, does anyone know if hyperterminal, or the parrallax serial terminal, can directly read a CSV file directly, instead of me having to copy and paste?
Thanks!
Comments
Otherwise, use hyperterminal to send the file over the serial line at a low baud rate so that the propeller chip has time to process the data.
What you should do is read one byte in at a time until the comma comes in. At that point turn the comma into a zero and use the numbers library to convert the decimal string into a pure binary number.
Then load that number into the table and move on.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
receiving one byte at a time is exactly what FDX+ does
with the method rx.
the fdx+-object has a receivebuffer of 16 bytes.
this means you can receive 16 bytes at max 115200 baud
without loosing a byte.
there are modifications of the fdx-object with bigger buffers
what baudrate are you using ?
how many bytes is your csv-file big
I did not test how fast you can store away received bytes.
As there exists a serial-object that does ALL the bit banging it SPIN at max 19200 baud
it should be easy for to store away bytes in SPIN that were received at 19200 baud
from the assembly-driver used by the fdx+-object
best regards
Stefan