04-03-2008 03:22 PM
04-03-2008 03:36 PM
04-03-2008 03:39 PM
04-03-2008 03:40 PM
04-03-2008 03:46 PM
04-07-2008 03:33 PM
cybertazer,
Thanks, the vi collects data now, but the data doesn't make any sense to me. If I open the attached file in notepad I get some characters that I do not recognize, whereas I thought it would just be ones and zeros. Is there a way to read this file with another program so I can make sense of it?
04-07-2008 03:52 PM - edited 04-07-2008 03:53 PM
Since you are getting hexadecimal numbers, that is what is being saved to the file. What you are seeing is the ASCII character for the stored Hex number. Many ASCII characters are unprintable or are crazy looking characters.
You'll have to determine how you want to save the data and what kinds of programs are going to open the file to read the data. Is it going to be another LV program?
You can use the hexadecimal string to byte array function to convert the string characters to their U8 value. If you want to store the values with commas in between, you can use the array to spreadsheet string or Write spreadsheet file with the appropriate format specifier to put the data out to a text file so that the numbers are human readable.

04-07-2008 03:54 PM
04-08-2008 07:26 AM
I use a program called Hexedit, which I think I got from www.download.com. If you need the actual hex characters in your file, after the string to U8 conversion, put a Number to Hexidecimal String conversion. Then change the Write Binary File to Write Text File.
One note on this... Doing it this way is a true representation of what came from the serial port... BUT it is not an exact representation. If you need to use this for any large amount of data, it will greatly slow down your program because it has to change from text to its native, binary form. If you are doing this just so you can see that everything is working ok, I suggest writing it as you do now... and ALSO writing it as I stated above as a text file. This way you can see in plain text exactly what is being written out. Use the binary file for your actual data manipulation. Then, when you are done testing, or you ramp up your code for higher speed, comment out the text portion.
Good luck...
04-08-2008 01:37 PM