Measurement function of the KFM2150 | Simple measurement procedure (MEASure)
Measurement procedure with flexibility (READ) | Most flexible measurement procedure (INITiate and FETCh)
Measurement using software triggers | Multipoint measurement with specified trigger count
Waveform data retrieval function

Most flexible measurement procedure (INITiate and FETCh)

Because the measurement procedure using the INIT and FETC? 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.

IMP:AVER:MOV:COUN 8 'Set the moving average to 8.

IMP:CURR:AC 100MA

  'Set the measuring AC current to 100 mA.
IMP:CURR:AC:FREQ 1KHZ   'Set the measuring AC current frequency to 1 kHz.
INIT;*OPC?   'Start the impedance measurement and wait for the measurement to be completed.

(Read the response)

 
FETC:IMP? 'Query the impedance data (magnitude) that has been measured.
(Read the response)
FETC:IMP:RES?;REAC?;PHAS? 'Query the resistance, reactance, and phase data.
(Read the response)

Note that *OPC? is sent with INIT. When *OPC? 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. Because the measurement is complete when this response is retrieved, the measured data can be retrieved using the FETC[:<meter_fn>]? query.

Another way to detect the completion of the measurement is to use *OPC in place of *OPC?. If the section after INIT;*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;*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 (magnitude) that has been measured.
(Read the response)  
FETC:IMP:RES?;REAC?;PHAS?   'Query the resistance, reactance, and phase data.
(Read the response)

*OPC sets the OPC bit (bit 0) of the event status register to true when all of the processing standing by is complete. In this example, the program is written so that *ESE and *SRE 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.