![Saluki S2438 Series Скачать руководство пользователя страница 105](http://html1.mh-extra.com/html/saluki/s2438-series/s2438-series_user-manual_3636124105.webp)
Tel: 886.909 602 109 Email: [email protected]
105
Preventing overlapping execution of the command
In order to prevent the overlapped execution of commands, multiple threads or commands: *OPC, *OPC? or *WAI can
be used. These three commands can be executed only after the hardware is set. While programming, the computer can
be forced to wait for some time to synchronize certain events. The details are separately described below:
Controller program uses multiple threads
Multi threads are used to wait for completion of the command and achieve synchronization of GUI and program control,
that is, a single thread waits for completion of *OPC?, without impeding the execution of the GUI or remote control
thread.
The usage of the three commands in synchronous execution is shown in the table below:
Table 5.5 Command Syntax
Method
Actions to be Executed
Programming Method
*OPC
Set the operation completion bit is
set.
Set ESE BIT0;
Set SRE BIT5;
Send the overlapped command and *OPC;
Wait for service request (SRQ)
SRQ represents the completion of execution of the
overlapped command
*OPC?
Stop executing the current command until
the
value
1
is
returned.
The
command
is
returned
only
when
the operation completion bit in the ESR is
set, which indicates that the
previous command is processed.
Terminate the processing of the current command
before executing other commands. Send this
command directly after the current command.
*WAI
Before executing *WAI, wait until all
commands are sent and continue processing
the uncompleted commands.
Terminate
the processing
of the
current
command before executing other commands.
Send this command directly after the
current command.
5.1.5 Status reporting system
The status reporting system stores all current operation status information and error information of the instrument. Such
information is stored in the status register and error queue respectively and can be queried through the remote interface.
5.1.5.1 Structure of the status register
The register classification is described as follows:
1) STB, SRE
Status Byte (STB) register and its associated mask register, Service Request Enable (SRE) register, constitute the
top-level register of the status reporting system. The STB saves the general working status of the instrument by
collecting low-level register information.
2) ESR, SCPI status register
STB receivers the information of the following registers: