Spectracom - Essential Ingenuity

SCPI Sequence for Continuous Measurements

Tutorial Steps

// reset the instrument settings
*CLS;*RST
*ESE 0;*SRE 0

// Meas function
:CONF:FREQ:BTB

// Input settings. Should be after CONF, because CONF sets up many subsystems
// including INPUT
:INP:LEV:AUTO OFF;:INP:LEV 0

// Pacing. Note: for FREQ:BTB measurement time is used as pacing. For
// PERIOD:BTB specify :TRIG:SOUR TIM;:TRIG:TIM 0.01
:SENS:ACQ:APER 0.01

// Packed format, Time Information On, use Intel Byte Order (LSB first)
:FORM PACK;:FORM:TINF ON;:FORM:BORD SWAP

// Turn off the display
:DISP:ENAB OFF

// Measure continuously
:TRIG:COUN 1;:ARM:COUN INF

// Set up SRQ on Message Available (MAV). This will generate SRQ when
// message is available in output buffer
*ESE 1;*SRE 16

// Clear SRQ-related registers by reading them
*SRE?

// read the response (library dependent call)
…// read STB (library dependent call)

// enable SRQ (library dependent call)

// initiate the measurement
:INIT

// read results continuously
loop
{
:FETC:ARR? MAX
// wait for SRQ (library dependent call)

// read STB to clear MAV SRQ (library dependent call).
// Please, note: STB should be read by system call, not by sending *STB?, as it will generate nested SRQ

// read and process response

}

// disable SRQ (library dependent call)


// reset the counter settings
*ESE 0;*SRE 0
*CLS;*RST

Please note: this sample can be implemented without SRQ (which is not recommended though), then SRQ initialization part can be omitted and no waiting-for-SRQ and reading STB is required in fetching loop (in this case make sure that appropriate bus timeout is set, otherwise you may end up with read timeout).

Was this information helpful?

 Yes  No