07-27-2018 08:39 AM
Hi,
Can anybody give me a direction on how to send the numbers in serial communication like " 0xaa, 0xff ".
I have checked with "visa write" and its not working on the target device. So, I have verified with Realterm software, the device responds well if "Send Numbers" instead of "Send ASCII".
I think by default LabVIEW is sending serial data as ASCII.
Solved! Go to Solution.
07-27-2018 09:15 AM
To really *understand* this takes a little bit of subtle mental gymnastics. It isn't so much hard to do as it is hard to be extremely careful about terminology while discussing it.
The basic unit of messaging over VISA is the Byte. A byte consists of 8 bits. There are many different kinds of terminology that can be used to identify what those 8 bits *mean*. Let's consider the 8 bits 01010101
You could express it as a binary-formatted number where each individual bit is shown. On a LabVIEW front panel control/indicator (with radix visible), this would look like: b01010101
You could express it as a decimal-formatted number: 85
You could express it as a hex-formatted number: x55
You could express it as an ASCII-coded string character: 'U'
*ALL* of these are accurate ways to express that bit pattern. You just have to think carefully about the terminology when you want to send a "number" across a serial connection where it tends to "take on the form" of a string character.
What might help is to know that both numeric and string indicators can be configured to display their contents in hex format. To send the numeric value known as x55, also known as decimal 85, then the string you send over VISA should also display as "55" when you choose to display in hex format. When you display as a normal string it'll look like "U". THEY ALL MEAN THE SAME THING!
-Kevin P
07-27-2018 09:16 AM - edited 07-27-2018 09:17 AM
@vargeeshj wrote:
I think by default LabVIEW is sending serial data as ASCII.
Nope. VISA just sees bytes in the string. What the data is is determined by how you formatted it.