04-03-2009 12:28 PM
Hi,
I have connected a GPS device to the USB port and attempting to read the byte code that the device sends out periodically. Problem is that when I read the data using the USB read function, I am getting all kind of gibberish data in the string output. I am using "Advanced Serial Write and Read.vi" from the examples of the USB read function.
If I use RealTerm software it shows me the correct data stream.
Example:
Data read from program is like:«ß/Bo8Á†[f«
Data read in real term is like:10 8F AB 00 00 E2 A4 04 etc.. the two lines of information dont correspond to each other, i just gave them as an example.
How do I go about interpreting/converting the read data to the second format?
Thanks & Regards,
Sandeep
Solved! Go to Solution.
04-03-2009 12:56 PM
Your first section does not make any sense. There is no such thing as Advanced Serial Write and Read from USB examples. The USB and Serial examples are as different as night and day. DO NOT CONFUSE USB WITH RS232/SERIAL!
Your second problem is just a matter of setting the string indicator to hex display. Right click on the indicator to change the display format.
04-03-2009 02:14 PM
My mistake, I mixed up USB and VISA. I was referring to VISA read function.
How simple a solution, and I did all sorts of things on the output to get the correct format!
I bow to you knight of NI!!
Thanks a lot,
Sandeep
04-03-2009 04:17 PM
I am able to get the display in the correct format, but if I get the output from VISA read directly for processing the string, it is still in the gibberish format! 😞 discovered that late!
What function can I use to convert it to hexadecimal format? Say if I want to compare it with a hexadecimal string or number?
Sandeep
05-15-2009 04:57 AM
08-02-2011 06:53 AM
The data whatever you use is always in Hexa decimal format only. All hexdecimal, Ascii text, octal, binary are just representations. If you need to process them as single byte, convert them to byte array (if you have many bytes to process)
08-02-2011 06:54 AM
Can you share the VI that you created for reading USB?
I am just starting to learn about USB communication in Labview.