R&S NGM202 User Manual page 147

Hide thumbs Also See for NGM202:
Table of Contents

Advertisement

®
R&S
NGL200/NGM200
Example: Configuring fastlog for scpi target
// ************************************************
// Configuring fastlog for scpi target
// ************************************************
*RST
:FLOG:STATE 0
:STATus:OPERation:ENABle 8192 //EnableSummary = true, bit 13
:STATus:OPERation:PTRansition 8192 // Enable Positive Transition, Summary bit 13
:STATus:OPERation:NTRansition 0
:STATus:OPERation:INST:ENABle 7
:STATus:OPERation:INST:PTRansition 7
:STATus:OPERation:INST:NTRansition 0
:STATus:OPERation:INST:ISUM1:ENABle 4096 // FastLogDataAvailable bit 12
//Enable Positive Transition, FastLogDataAvailable bit 12
:STATus:OPERation:INST:ISUM1:PTRansition 4096
:STATus:OPERation:INST:ISUM1:NTRansition 0
// Clear event registers
:STATus:OPERation:EVENt?
:STATus:OPERation:INST:EVENt?
:STATus:OPERation:INST:ISUM1:EVENt?
:FLOG:TARGet SCPI
:FLOG:SRATe S250k //initialize scpi target with sample rate 250 kS/s
*OPC?
:FLOG:STATE 1 // start fastlog
// receive data once 'FastLogDataAvailable' is available
Loop
StatusByte = *STB?
if (StatusByte.IsOPERationStatus) //bit 7
{
User Manual 1178.8736.02 ─ 06
OperationRegister = :STATus:OPERation:EVENt?
if (OperationRegister.IsSummary) //bit 13
{
InstRegister = :STATus:OPERation:INST:EVENt?
if(InstRegister.Channel1) // bit 1
{
InstSumRegister = :STATus:OPERation:INST:ISUM1:EVENt?
if(InstRegister.FastLogDataAvailable) //bit 12
{
// scpiBinaryData : format "#<digits_of_length><length><binary_data>"
byte[] scpiBinaryData = :FLOG:DATA?
float[] raw = convertScpiBinaryDataToFloatArray(ScpiBinaryData)
float[] voltage = raw[0,2,4,...]
float[] current = raw[1,3,5,...]
// do work
}
}
}
}
Remote Control Commands
Data and File Management Commands
144

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ngm200 seriesNgl200 seriesNgl-com2aNgl201Ngl202Ngm201

Table of Contents