LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple GPIB commands in labview

The only way I have ever figured out how to send more than one command
to a device using labview code has been using case statements. This
method seems tedious and uses lots of code. Could someone please show
me how they would talk to a device without lots of case staments and
lots of Gpib writes and reads?

THANK YOU!
0 Kudos
Message 1 of 2
(3,600 Views)
Sending multiple commands in LabVIEW is the same as in other languages. Most instruments allow multiple commands by using the semi-colon as a separator. Thus you might build a string such as "FUNC:VOLTS DC;RANGE:AUTO". After the string is constructed, you can then do a single VISA write. How you actually construct the strings can be done in a variety of ways. There are functions like Pick Line, Index String Array, Append True False String, and Format Into String that are very helpful. Sometimes you'll find that you have to use a couple of case statements as well. There's some links to app notes at Instrument Drivers-IVI that you
might find useful. There's also a lot of existing instrument drivers that you can download and get some ideas on how to better write your own. Unfortunately, an awful lot of them are really bad examples of effective coding and don't follow NI's own standards.
0 Kudos
Message 2 of 2
(3,600 Views)