3 - 76

USING THE COMBISCOPE INSTRUMENTS

3.15.4How to report errors

Instrument errors usually caused by programming or setting errors, can be reported by the instrument during the execution of each command. To make sure that a program is running properly, you should query the instrument for possible errors after every functional command. This is done by sending the SYSTem:ERRor? query or the STATus:QUEue? query to the instrument, followed by reading the response message. However, through this practice the same "error reporting" statements must be repeated after sending each SCPI command. This is not always practical. Therefore, one of the following approaches is advised:

1)Send the SYSTem:ERRor? or STATus:QUEue? query and read the instru- ment response message after every group of commands that functionally belong to each other.

2)Program an error-reporting routine and call this routine after each command or group of commands. For an example of an error-reporting routine, refer to section 3.16.4.1.

3)Program an error-reporting routine and use the "Service Request (SRQ) Generation" mechanism to interrupt the execution of the program and to execute the error-reporting routine. Therefore, refer to section 3.16.4.2.

3.15.4.1Error-reporting routine

Send the SYSTem:ERRor? or STATus:QUEue? query and read the instrument response after every group of commands that functionally belong to each other, by calling an error-reporting routine after each group of commands.

PROGRAM EXAMPLE:

DIM response AS STRING * 30

Configures for AC-RMS

CALL Send (0, 8, "CONFigure:AC (@1)", 1)

FOR i = 1 TO 20

Performs 20 measurements

CALL Send (0, 8, "READ:AC?", 1)

 

CALL Receive (0, 8, response$, 256)

Reads the AC-RMS value

PRINT "AC-RMS: "; response$

Prints the AC-RMS value

GOSUB ErrorCheck

Checks for instrument errors

NEXT i

 

*****

 

***** REST OF THE APPLICATION

 

*****

 

END

 

ErrorCheck:

 

CALL Send (0, 8, "SYSTem:ERRor?", 1)

Queries for a system error

CALL Receive (0, 8, response$, 256)

Reads the instrument error

PRINT "Error: "; response$

Prints the instrument error

RETURN

 

Page 95
Image 95
Fluke PM-3380B, PM-3390B, PM-3370B, PM-3394B, PM-3384B user manual How to report errors, Error-reporting routine