I am using Matlab to control a 9340B as a VISA object. It seems to be working fine except that I am unable to determine when a sweep ends. According to the programming manual I should be able to monitor bit zero of the event status register or, if the ESE bit is enabled, bit 5 of the status register. Neither seem to work. Figure 2 of the programming manual indicates that bit zero is the operation complete signal. However the table on the next page, page 29, indicates that bit zero is "Unused". Is it used and is it the operation complete bit? The sequence of commands is as follows:
*CLS
:INIT:IMM
*OPC
And then I observe the status using *STB? but I read all zeros even after the slow sweep has completed. The ESE register is all ones. I can write an incorrect command to the 9340B and observe that the status register indicates that the command was bad, that is, not all zeros.
*CLS
:INIT:IMM
*OPC
And then I observe the status using *STB? but I read all zeros even after the slow sweep has completed. The ESE register is all ones. I can write an incorrect command to the 9340B and observe that the status register indicates that the command was bad, that is, not all zeros.
As I see you don't want to use * OPC? to block your program, which can't monitor the sweep time, I suggest you to user a marker to monitor the sweep time.
Below is the example that determine the end of a sweep by detecting marker readout result.
SCPI command list:
*RST
:INIT:CONT 0
:FREQ:SPAN 800 MHz
BAND 30 kHz
:CALC:MARK:X 3000000000
:INIT
%Then start to read the Marker readout
:CALC:MARK:Y?
When the Marker readout changes, the sweep of N9340B has finished. you can get the sweep time.