08-27-2008 09:26 AM
Hi, I am trying to convert an ASCII string into an array of decimal numbers but i was unsuccessful storing all the numbers into the array.
Can anyone help?
I am attaching the vi + the .dat file
Thanks,
Christos
08-27-2008 09:45 AM
Hi Christos,
what you are doing is far to comlicated. You can just use an indexed tunnel on the for-loop. See my vi (or screenshot).
I hope that helps, RMathews
08-27-2008 09:47 AM - edited 08-27-2008 09:48 AM
Even that is more complicated than it needs to be.
Use either
(a) the Spreadsheet String to Array function
(b) Read From Spreadsheet File (and then simply peel off the first column).
P.S. Eliminate the sequence structure - it's unnecessary.
08-27-2008 09:53 AM
08-27-2008 10:05 AM - edited 08-27-2008 10:06 AM
Hi Christos,
see the picture please.
Mike
08-27-2008 10:30 AM - edited 08-27-2008 10:31 AM
08-27-2008 11:18 AM - edited 08-27-2008 11:19 AM
05-06-2010 02:05 PM
Hi,
I'm taking measurements with home-made instrument and collect data from it using labview but it is not in decimal numbers. It could be Ascii or hex and I tried many conversions but couldn't get it right. I attached the data file. I'd appreciate it if anyone could help me with that.
thanks
sbz
05-06-2010 02:47 PM
Hi sbz,
it would really help when you could also show an expected result from your mangled data file. It seems to contain a lot of (short) lines with just 3 bytes per line, but randomly there's a TAB inbetween...
So do you have any idea what those 3 byte entities represent?
05-07-2010 06:00 AM
Hi Sbz,
You said that you are reading from a home made instrument, is that right? If so, what values where you sending. If you was just sending from a microcontroller decimal values of a reading for example then when you read this on your computer it will be presented as ascii. If you want to convert the ascii to decimal values use the 'String to byte Array' function:
As was mentioned by your other response, it appears that you are sending 3 bytes at a time followed by a new line charector? if so you will either have to get rid of the newline charector as you recieve the bytes, ie read bytes until newline charector, ignore but send bytes to buffer for processing. Or get rid of them somehow during post-processing.
If you could give us more information on what data you are actually sending then we would be in a better position to help.
Rgs,
Lucither