Tel: 886.2.2175 2930 Email: [email protected]
www.salukitec.com
256
The returned result may be the current starting frequency of the instrument before command sending, as the commands will be
executed one by one by the host program after command messages are received. The returned result may be 1GHz in the case of
execution after the commands are received by the host program.
Setting commands and query commands are sent separately.
General rules: setting commands and query commands should be sent in different program messages in order to ensure that the
returned results of query commands are correct.
9.1.4.1.
Prevention of Overlapping Execution of Commands
In order to prevent overlapping execution of commands, multiple threads or commands can be applied, including *OPC, *OPC? or
*WAI. The three commands cannot be executed until the hardware is set. The computer may be forced to wait for a certain period to
synchronize certain events in the programming process. The above methods are described below.
Use multiple threads in the control program.
Multiple threads are used to complete waiting commands and synchronize the user interface and program, that is, the command
"*OPC?" is executed in each single thread, with no blockage of GUI or program threads.
The use of three commands in synchronous execution is shown in the following table.
Table 9.5 Command Grammar
Method
Execution Action
Programming Method
*OPC
After command execution, set the operation completion bit in
the ESR register.
Set ESEBIT0;
Set SREBIT5;
Send the overlapping command and *OPC;
Wait for the service request signal (SRQ).
The service request signal means that the overlapping command has
been executed.
*OPC?
Stop executing the current command and return to 1. Only
when the operation completion bit in the ESR register is set,
the command will be returned, indicating that the previous
command has been processed.
End the current command processing before executing other
commands. Directly send the command after processing of the
current command.
*WAI
Before executing *WAI, wait for sending of all commands. Then
process the uncompleted commands.
End the current command processing before executing other
commands. Directly send the command after processing of the
current command.
9.1.5.
Status Report System
The status report system is used to save all operation status information and error information of the current instrument. The operation
status information and error information are respectively saved in the status register and error queue and can be inquired through the
programmed interface.
Structure of status register organization
Application of status report system
9.1.5.1.
Structure of Status Register Organization
Register categories are as follows: