07-10-2019 11:21 AM
2 or more GPIB devices getting a command sent to it sequentially, as in one device is getting a get temperature command continuously while the second device wants to start up and do the same. How can I do this in labview with both devices on the same BUS?
07-10-2019 12:11 PM
Just make sure they all have different addresses and you should be able to talk to each on individually.
07-10-2019 12:16 PM
so if I send a command to GPIB0::4 and also I send it to GPIB0::5, does labview or the gpib-usb-hs automatically wait for one to finish sending the command, and then send it to the next or do I have to program a delay or something like that?
07-10-2019 01:02 PM
Since you are also expecting data back, you should probably make a non-reentrant VI to send the message and read back the response. Then the VI will act as your semaphore/lock so that only one instrument will be allowed to talk at a time.
07-10-2019 01:06 PM
thanks for the response.
this sounds good, yet I have no idea what a non-reentrant VI is.
Would you happen to have an example?
07-10-2019 01:18 PM - edited 07-10-2019 01:19 PM
Reentrancy is a property of each VI. The default is non-reentrant, meaning if 2 places try to call it at the same time, one will get it first and when it is done the second place will get it. You can enforce which one call gets run first by making use of dataflow. You can use shared clone if everywhere the VI is called the history has no impact. You can use preallocated clone if you want each place the VI is called to have its own memory space. So if you are using, for example, feedback nodes, the history will be kept intact for each specific call of the VI.