LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

decoding in Labview, ASCII, Unicode

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

0 Kudos
Message 1 of 6
(3,581 Views)

Hi Matthew,

 

Could you provide the model of the device you are using? Are you using VISA communication? 

 

Andy C.

Applications Engineering

National Instruments 

0 Kudos
Message 2 of 6
(3,538 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(3,534 Views)

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!

0 Kudos
Message 4 of 6
(3,504 Views)

Yea it is VISA communication. Thz so much Smiley Happy

0 Kudos
Message 5 of 6
(3,503 Views)

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


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(3,499 Views)