LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating with a non-message based instrument serially

The device I need to communicate serially with isn't message based. It is controlled by specific sequences of bytes. I'm assuming the best way would be to use VISA somehow. Anything that would point me in the right direction would be great, Thanks! I'm using Labview 5.1.1
0 Kudos
Message 1 of 3
(2,671 Views)
The first thing to do is don't freak with things that don't communicate using human-readable strings of bytes. Bytes is bytes--just some of them we interpret as letters and numbers. Computers don't care one way or another...

Ok, with our existential philosophical digression set to one side, in the past when I have had to do this sort of thing I found it easiest to build my command sequences as arrays of U8 values. This is good because you can set the array indicators' radix to hex and see that the sequence of bytes is what you are wanting. Then to send it all you have to do is convert the array to a string using the "Byte array to string" function and send the resulting string to a VISA write. There is no special routine for writing 'binary' data becau
se, as I said before: Bytes is bytes...

The only thing that might get tricky is if the communication protocol requires some sort of wierd handshaking. One time I had one where the first byte of each message ahd to be sent with odd parity and then the rest of the message with even parity.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 3
(2,671 Views)
In addition to what Mike said, you might want to see if someone already wrote an instrument driver for your device to save yourself the hassle. Check with the manufacturer of the device directly, and also check out our own repository of instrument drivers for many different devices.

The Instrument Driver Network is at ni.com/idnet.

Good luck,
Josh Hernstrom
PXI/VXI Product Support Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,671 Views)