06-25-2013 06:45 PM
hello guys! I am a Labview novice and trying to build a program which communicates with an angular orientation sensor, which sends data in 2 formats, ASCII and binary.
When handling the data sent from the orientation sensor coded in ASCII, some garbled codes are returned somehow. I don't really understand how Chinese characters can come out, when the data is encoded in ASCII. I am personally using a Chinese Windows 7 platform, but that shouldn't affect the program since my labview is in English.
Is there anyway to control how Labview decode the bytes of data sent from the sensor? I doubt that it might be using Unicode or something to decode the data bytes, resulting in the garbled codes.
Thanks in advance!
Matthew
06-26-2013 12:26 PM
Hi Matthew,
Could you provide the model of the device you are using? Are you using VISA communication?
Andy C.
Applications Engineering
National Instruments
06-26-2013 12:32 PM
How are you communicating with your device? If using RS-232, make sure your baud rate is correct. That is the common reason I have seen a mess of bytes like that. The other option is that the instrument is returning binary data. Try chaning the view of your string to Hex and see if the data makes any sense that way.
06-27-2013 12:34 PM
Thanks for all your replies!
Yea I am using RS232, through a USB-to-SERIAL cable, to communicate with a central processor called Rabbit, which connects in turn to the orientation sensor.
The program that governs the central processor is written by myself. I am pretty sure it's working fine.
The question I am having now is whether it is possible for Labview to interpret characters using the 128 ascii code (1 byte) instead of the 2 byte ascii code. If so, the random Chinese characters should not appear and my data should come out normally. Do we have something in the "property node" to deal with that?
Thank you so much for your help!
06-27-2013 12:35 PM
Yea it is VISA communication. Thz so much
06-27-2013 12:43 PM
Its probably something in your port set-up. The VISA (and Windows) defaults are 9600,8,none,1. you might need to look into the manual of the device on the other end to find what it is sending