LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to communicate with IEEE device

This is a little off the topic of this thread but I thought you guys could answer this fairly easily.  I am using VISA write to control a GPIB device.  Is it possible to send two commands using one visa write vi call by just delimiting the commands in the input string?
 
Thanks, Brian
0 Kudos
Message 11 of 17
(1,156 Views)
Yes.  Most instruments will accept multiple GPIB commands separated by a semicolon, such as ":FUNC:VOLTS 5; :TRIG:IMM".  Send as many commands as you want in one GPIB write.
- tbob

Inventor of the WORM Global
0 Kudos
Message 12 of 17
(1,150 Views)
It would however, be best to double check the product manual to make sure that you can send more than one command at once...  I have run into a few pieces of equipment that only take one at a time, but give no error and only use the last received, leaving you confused and frustrated.  I learned the hard way.
0 Kudos
Message 13 of 17
(1,143 Views)
> I'll look into using VISA, and the VISA Lock though. 
 
If my foggy memory serves me right, there are some GPIB cards (or was it a LAN/USB to GPIB converter?) that don't lock.  You may want to test your platform first before putting this into a "it may happen once every other day" kind of thing.
 
0 Kudos
Message 14 of 17
(1,213 Views)
Yes, I think I just ran into one that only accepts one command at a time as well.  Thanks for the  help.
Brian
0 Kudos
Message 15 of 17
(1,132 Views)

Will, tbob, and Dennis, I saw this conversation from about 3 years ago.  I'm currently working with VISA Locks and Unlocks to control calls to two devices on a GPIB.  It's the first time we've implemented the Locks and Unlocks in a program and we still get conflicts which come up with general statements such as "lock can not be found", or "device already locked".

Our code consists of a VISA Open, a VISA Lock, a call to the instrument, a VISA Unlock, and finally a VISA Close each time either device is used.   This code is executed from different While loops which are all running concurrently.  Have I been too naive to think that any and all conflicts will be handled by the Lock and Unlock functions?  Any tricks of the trade to using the Lock and Unlock.

Any suggestions would be greatly appreciated.

Nick

Nick Salemi
Teledyne Energy Systems, Inc.
nick.salemi@teledynees.com
410-891-2225
0 Kudos
Message 16 of 17
(932 Views)
> I'm currently working with VISA Locks and Unlocks to control calls to two devices on a GPIB. 
> It's the first time we've implemented the Locks and Unlocks in a program and we still get conflicts
> which come up with general statements such as "lock can not be found", or "device already locked".
 
It's been a while since I've dealt with this and maybe things have gotten better over the years, but...
There can be a lot of problems here, especially if you are dealling with a remote (LAN-GPIB) and 2 or more computers.  Some devices did not have a lock, and the VISA of one computer may not know that the other computer exists.  If we needed to lock (from different programs) we used semiphores or file locking for the flag.  But GPIB may be better today.  OTOH, your report sounds like it's the same.
 
~~Les Hammer
0 Kudos
Message 17 of 17
(903 Views)