LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send numbers over serial communication

Solved!
Go to solution

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.

 

1.PNG

0 Kudos
Message 1 of 3
(4,116 Views)

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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 3
(4,094 Views)
Solution
Accepted by topic author vargeeshj

@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.


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 3
(4,092 Views)