Example 8: Query the Status Register
Users can judge current operation error by querying the status register. All the
commands about the status register have been discussed in chapter 2. For RIGOL,
Fluke and Agilent commands, commands about the status register are available, here
we will take RIGOL commands for example.
The programming steps——RIGOL Commands:
0 *RST /*Reset the instrument for preparing measurement*/
1 cmdset□rigol /*Select RIGOL commands*/
2 *cls /*Clear the instrument state*/
3 status:questionable:enable□24375 /*Set the enable register of the questionable
status register*/
4 status:operation:enable□1841 /*Set the enable register of the operation
status register*/
5 *ESE□189 /*Set the enable register of the event status register*/
6 *SRE□188 /*Set the enable register of the status byte register*/
7 :status:questionable:enable? /*Query the enable register of the
questionable status register*/
8 Return: 24375
9 :status:operation:enable? /*Query the enable register of the operation
status register*/
10 Return: 1841
11 *ESE? /*Query the enable register of the event status register*/
12 Return: 189
13 *SRE? /*Query the enable register of the status byte register*/
14 Return: 188
15 :function:voltage:AC /*Enable AC voltage measuring function*/
16 *STB? /*Query the condition register of the status byte register*/
17 Return: 192
18 :status:questionable:condition? /*Query the condiction register of the
questionable status register*/
19 Return: 0
20 :status:operation:condition? /*Query the condiction register of the
operation status register*/
21 Return: 256
22 *ESR? /*Query the event register of the event
status register*/