Accessing Variables in MATLAB User-Operator Scripts

Instrument
DCA-X
N109x
UXR Scope
Flex Apps:
FlexDCA
FlexRT
MATLAB

Input Variables

When FlexDCA starts a user-operator script, the following variables are placed in the MATLAB workspace:

Each input variables, except SoftwareVersion, listed in the following table has two forms. The one listed is for a single input waveform or the waveform 1 of a dual-waveform input measurement. If a second input waveform exists, its variable has the digit "2" appended. For example, SrcData becomes SrcData2 for the second waveform.

Input Variables
Variables Description
SrcData The input waveform. Values are in volts for electrical signals and Watts for optical signals.
Source The source of the input waveform.
Example: Source = 'Channel 1B'
SourceBw The bandwidth of the input source.
Example: SourceBw = 150000000000.0
XOrg The time of the first x-axis value of the input waveform value of SrcData.
Example: XOrg = 8.785e-11
XInc The spacing of the x-axis input waveform values of SrcData.
Example: XInc = 2.232e-13
XUnits The X units associated with the input waveform. Refer to Valid Measurement Units.
Example: XUnits = 'Second'
YUnits The Y units associated with the input waveform. Refer to Valid Measurement Units.
Example: YUnits = 'Volt'
BitRate FlexDCA A.05.61 and below. Removed in FlexDCA A.05.62 and above. Use the SymbolRate variable instead.
The current value of the 'Data Rate' control in the pattern lock tab of the trigger setup dialog. If pattern lock is not turned on, this value may not be correct.
Example: BitRate = 9953280000.0
SymbolRate Available FlexDCA A.05.62 and above.
The current value of the 'Symbol Rate' control in the pattern lock tab of the trigger setup dialog. If pattern lock is not turned on, this value may not be correct.
Example: SymbolRate = 9953280000.0
PatLength The current value of the 'Pattern Length' control in the pattern lock tap of the trigger setup dialog. If pattern lock is not turned on, this value may not be correct.
Example: PatLength = 127
SrcClipped Set to True if the source data was clipped high or low; otherwise set to False.
Example: SrcClipped = True
ClipHigh The maximum value that could be present in the source waveform. If SrcClipped is True, check to see which elements of SrcData are equal to ClipHigh to determine which elements were clipped.
Example: ClipHigh = 0.51057
ClipLow The minimum value that could be present in the source waveform. If SrcClipped is True, check to see which elements of SrcData are equal to ClipLow to determine which elements were clipped.
Example: ClipLow = -0.510869
IsAvgComplete Flag tells if waveform averaging is complete. Set to True if complete, otherwise False if not complete.
Example: IsAvgComplete = True
IsPeriodic Flag tells if waveform is periodic. Set to True if complete, otherwise False if not complete.
Example: IsPeriodic = False
AvgAcqCount The current value of the 'Number of Averages' control in the Averaging tab of the Acquisition dialog if averaging is enabled, otherwise its value is 1.
Example: AvgAcqCount = 1
TdrAmplitude The current amplitude of the TDR waveform. Available in TDR mode only.
TdrPolarity The current polarity of the TDR waveform. Available in TDR mode only.
TdrRiseTime The current rise time of the TDR waveform. Available in TDR mode only.
DielectricConstant The dielectric constant of the TDR waveform. (If horizontal units are defined in distance instead of time.)
VelocityFactor The velocity factor of the TDR waveform. (If horizontal units are defined in distance instead of time.)
Markers Marker information if markers are on source waveform. If a marker is not on, it is not available.
Example: x = Markers(1).Position
Markers = [struct('Name','X1','Source','Channel 1A','Position',5.9853e-10,'Status','Correct')...
struct('Name','X2','Source','Channel 1A','Position',6.4853e-10,'Status','Correct')...
struct('Name','X3','Source','Channel 1A','Position',8.0353e-10,'Status','Correct')...
struct('Name','X4','Source','Channel 1A','Position',8.5603e-10,'Status','Correct')]
SoftwareVersion The FlexDCA software version that is being run.

Output Variables

This topic lists the variables whose values are returned to FlexDCA when your script completes. The top three variables listed in the table must be set in your script. The remaining variables may be used, if needed.

Output Variables
Variable Description Returned
Required Optional
FiltData Output waveform.
XInc The spacing of the x-axis values of FiltData.
XOrg The time of the first x-axis value of FiltData.
ErrorMsg Any generated FlexDCA error message.
FilterDelay Filter delay.
FilterWidth Filter width.
Gain Signal gain of operators that have one input.
Gain2 Signal gain of operators that have two inputs.
XUnits The X units associated with the output waveform's x-axis. Refer to Valid Measurement Units.
YUnits The Y units associated with the output waveform's y-axis. Refer to Valid Measurement Units.