Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use *OPC and *OPC? to speed up data communication using GPIB and VB5?

I have written a VB5 program which communicates with a Vector Network Analyser (VNA) via a PCI GPIB to send device settings and to read data values.

Currently each command is followed by a 0.5sec programmed delay to ensure the VNA has time to complete each command.

However, I think this may be increasing the time the program takes to complete its task. How do I go about using the *OPC and *OPC? (or WAIT [??]) commands in a VB5 program so that the 0.5sec delay after each command can be removed and the VNA tells me when it is ready for the next command?

Can anyone replying consider that I do know that status byte registers exist, but that I have no idea what they are or how to use the
m. Thanks
0 Kudos
Message 1 of 2
(4,823 Views)
Assuming that the instrument is fully compliant with the IEEE488.2 std...

The *OPC command makes the instrument assert the OPC bit on the Status Byte Register when all the pending command processing have completed. This can also be hooked up by the SRQ if the Serial Poll Enable register is properly confiured by the *SRE command.

The *OPC? query makes the instrument generate a response message "1" when all the pending command processing have completed.

If your app does not need do background processing during the command processing and just need make sure the instrument processes the given commands synchronously, the easier approach is use the *OPC? query. You can just send an *OPC? query and just read its response and there is no need to process SRQ eve
nt handling or a serial polling loop. That's all.

Hope this helps.
Makoto
0 Kudos
Message 2 of 2
(4,823 Views)