From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending multiple string commands to GPIB instrument

Hi. I just starting to learn to use LabVIEW.

I am using Labview 7.1 and using the "Labview<->GPIB.vi" example to communicate with my GPIB instrument.
The only way I can send multiple query commands is as a single string, each command separated by a semicolon (*idn?; syst:time?; syst:date? and etc.). I am able to receive the response as a single string for each query, each response separated by a semicolon ("name of the instrument"; "system time"; "system date" and etc.).

I want to be able to send these commands as a 1D array of string. "Concatenate String.vi" won't work for me because I have to type in each commands on the front panel. I don't think "Search/splt.vi" won't work either because I still have to type in the commands a single string.

Any suggestion?


nana
0 Kudos
Message 1 of 2
(3,047 Views)
nana,

you have most of the code already there!

Basically you just need a For- or While-Loop around what you have.

If you prefer a For-loop, than create an array control or constant of strings and fill it with all the different strings you'd like to send. Don't forget the and or character those devises usulaly require. Either concatenate it inside the loop or enter it manually. Wire this array to the loop boundary - it will autoindex and be a single string inside of the loop. Wire this string to the GPIB send command. Wire the devices reply to the right side of the loop. Create a display for this ouside of the loop and you'll get all the replys as an array as well.

If you prefer While loops, keep in mind that those do not autoindex per default; it can, however be activated by a right-click.

HTH and
Greetigs from Germany!
--
Uwe
0 Kudos
Message 2 of 2
(3,043 Views)