Monday, December 30, 2013

Difference between SCPI commands *WAI, OPC? and OPC

Spent some time trying to know the inside out of *WAI, OPC? and OPC, didn't work out quite well though. 

There are conflicting explanations regarding both *WAI and OPC?. In the case of *WAI, some say it will hold the instrument only, others say it will hold the whole bus; In the case of OPC?, some say the user himself needs to poll the output status constantly, others say no such thing is needed for it will hold the entire bus for you without the need to constantly poll. Alas the only unequivocal command is OPC, which turned out to be the most complicated of all three to use and thus most flexible, because of which perhaps even least used? 

Maybe part of the reason is that it's up to the manufactures to implement these commands and each has its own liking? 

For now, stick to *WAI for simplicity. It may or may not affect other instrument, but for sure it will hold the instrument under it until all commands in its buffer are completed, given sufficient timeout of course.

Materials to read:
  • Hints and Tricks for Remote Control of Spectrum and Network Analyzers 
  • R&S®ZVA / R&S®ZVB / R&S®ZV Vector Network Analyzers Operating Manual, look in "programming examples", which claims "*WAI does prevent the controller from sending other commands to the analyzer or other devices"
  • Synchronizing the PNA and the controller by Agilent, which claims "Note: Although *WAI stops the analyzer from processing subsequent commands, it does not stop the controller. The controller could send commands to other devices on the bus.