Tutorial > Measurement Using a Single Measurement Function > The most flexible measurement procedure
Measurement Using a Single Measurement Function
The most flexible measurement procedure (INITiate and FETCh)
Because the measurement procedure using the INIT command and FETC[:<meter_fn>]? query separates the measurement start and data acquisition procedures, it enables the most detailed control. INIT is used to start the measurement, and FETC is used to query the data of a measurement that has been completed. The INIT command and FETC[:<meter_fn>]? query must be used in place of the MEAS:<meter_fn>? and READ[:<meter_fn>]? queries in order to use the software trigger to control the measurement start timing.
There are variations to the FETC? query such as FETC:IMP?, FETC:VOLT?, and FETC:CURR?. There are more detailed variations of FETC:IMP such as FETC:IMP[:MAGN]?, FETC:IMP:RES, FETC:IMP:REAC?, and FETC:IMP:PHAS?. FETC:IMP? and FETC:IMP:MAGN? are same functions.
Example: (KFM2005)
CONF:IMP | 'Set the impedance measurement conditions to default. | |
IMP:AVER:COUN 4 |
'Set the integral average to 4. | |
IMP:AVER:MOV:COUN 16 | 'Set the moving average to 16. | |
IMP:CURR:AC 165E-4 | 'Set the superimpose current to 16.5 mApp. | |
IMP:CURR:AC:FREQ 1KHZ | 'Set the measuring AC current frequency to 1 kHz. | |
INIT:SEQ1;*OPC? | 'Start the impedance measurement and wait for the measurement to be completed. | |
(Read the response) | ||
FETC:IMP? | 'Query the impedance data (absolute value) that has been measured. | |
(Read the response) | ||
FETC:IMP:RES?;REAC?;PHAS? | 'Query the resistance, reactance, and phase data. | |
(Read the response) |
Note that the *OPC? query is used with the INIT command. When an *OPC? query is sent, an ASCII character 1 is set in the output queue when all of the standby procedures (impedance measurement in this example) are completed. Therefore, 1 should be retrieved when the response after *OPC? is read. When this response is retrieved, the measurement is complete. Then, the measured data can be retrieved using the FETC[:<meter_fn>]? query.
An *OPC command can be used in place of the *OPC? query to detect the completion of the measurement. If the section after INIT:SEQ1;*OPC? in the aforementioned example is replaced with the lines below, a service request can be generated when the measurement is complete.
*ESE 1;*SRE 32;*CLS;INIT:SEQ1;*OPC | 'Start the impedance measurement and 'wait for the measurement to be completed. |
|
(Wait for the SRQ to be generated) | ||
FETC:IMP? | 'Query the impedance data (absolute value) that has been measured. | |
(Read the response) | ||
FETC:IMP:RES?;REAC?;PHAS? | 'Query the resistance, reactance, and phase data. | |
(Read the response) |
The *OPC command sets the OPC bit (bit 0) of the standard event status register to true when all standby procedures have been completed. In this example, the program is written so that the *ESE and *SRE commands generate a service request (SRQ) when the OPC bit becomes true. However, the event handling using the SRQ is a function only available on the GPIB and USB interfaces. It cannot be used on the RS232C.