ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

取消
显示结果 
搜索替代 
您的意思是: 

Communicate to Two instruments Simultaneously via VISA

I'm thinking of ways of solving my problem, but I've run in into a question I cannot answer.

Say I'm communicating with my instrument (Instrument 1) via VISA. Now at a particular point in my program (say, when "Function XYW" is executed), I want to send a command to another instrument (Instrument 2). Is this possible? Is it really as easy as  setting up  two VISA connections within my program?

Thank you,
Alex
0 项奖励
1 条消息(共 5 条)
4,872 次查看
You have to be careful when you use a word like simultaneous. A GPIB connection is possible for only one instrument at a time. The communication is sequential and to communicate to a second instrument, you need a separate VISA session. You would typically control execution order with the error in/error out clusters. If you are using serial, then each instrument is connected to a separate port and you just need the separate session and communication can be done in parallel.
0 项奖励
2 条消息(共 5 条)
4,871 次查看
Hmm.. I suppose I was curious because after all, I can have two GPIB cables connected to my computer.

Couldn't I set up two VISA connections with different GPIB addresses? What exactly is the conflict here?
0 项奖励
3 条消息(共 5 条)
4,865 次查看
Of course you have multiple cables but the GPIB protocol does not allow for parallel communication in most cases. You address one instrument and write to it. Then you address a second instrument and write to it. The interval might be pretty small but it is not simultaneous. You can run into issues during reads. If you are in the middle of reading one instrument and a parallel process tries to read or write to a different instrument, you can interupt the first read and the instrument will throw a 'query interupted' error.
 
There is a little bit of parallelism built into the GPIB protocol such as triggering multiple instruments and sending the same data to multiple instruments but that's probably only useful if the instruments are the same.
4 条消息(共 5 条)
4,858 次查看
You can have multiple instruments connected and working at the same time on the same PC.  However, if you are using GPIB, although you communicate to the instruments in parallel, they will not communicate simultaneously.  It will be nearly at the same time.  So you can't use the PC to trigger the start of an acquisition and have them start at the very same time.  There are tricks you can do on some instruments, but let's not go into that...
 
Now it also depends on your definition of "at the same time"...  If you allow 4 to 100 ms delay between the two, then yes, you should be able to accomplish that.  However, you will have to be careful of Query commands or when reading data back from an instrument.
 
R
0 项奖励
5 条消息(共 5 条)
4,849 次查看