Local Variable Usage and Efficiency
|Tip! The LV can only be used in a subsequent section from the section it is defined. If a single test section needs to use the variable, split the panel into two stages, one to set the value, the next to use it.
The "Set from Local Variable" (SFLV) construct is one of the most powerful in the RI Software environment. To use it properly there are several steps required and a few considerations for test plan efficiency.
The SFLV allows the testplan to use a value not known at compile time, to set an instruments value. Some examples are Bias current setting, where a voltage supply is adjusted for a desired current level or "Fixed output power" for a Power Amplifier, where Pin is swept for a desired Pout and then Pin is set (at the appropriate value) for the ensuing suite of measurements.
The knowledge that a testplan is a compiled program raises the question of how is this accomplished? Cal data and low level system commands must be created in real time efficiently. This fact must be considered by the application developer. To accomplish a SFLV the tester performs a "Mini-Compile" during run time. This is where the tester creates the machine code to set the instrument to the value calculated on the fly. Some thought as to what must occur during a Mini-Compile provides insight into how to use the SFLV effectively.
1.) A mini-compile takes time:
This is obvious. However with some thought it's effects can be minimized. For instance, If several parameters in a testplan get set SFLV, try to make sure they get set all at once. An example is Modulator Quadrature Error Search. In that case the tester finds four parameters, IQ gain, phase balance, I and Q DC offsets. It is more efficient to find these and then set them all at once, rather than to have multiple sets
2.) A mini-compile takes the tester to a state that is unknown at compile time:
Because of this, the tester doesn't know exactly where the parameter is. To guarantee control is taken back by the tester, Set the parameter to a known value (preferably the first value required in the next run of the plan) in the "Disconnect Settings".
3.) A mini-compile can take the tester to a state that requires Calibration Data unknown at compile time:
Typically this refers to Setting Frequency from LV, such as finding a VCOs peak output then setting the receiver to the frequency of the peak output. In this case, during compile, the tester needs cal data from the Fixture, Testhead, and Receiver. This data would take too long to acquire during run time. As such a way is required to know this data (within some margin) during compile. This is done with the "Target Value" pick on a Set from LV parameter. In this case the cal data from the target value is gathered at compile time and the data at the final measured frequency can then be computed properly.
If this is not done the tester will use the cal data from the Receiver's default frequency. A simple test to see if this Target Value set is needed is to compare a worksheet recorded value to a controller value. The controller has access to the correct cal data in real time, the worksheet data save only can use cal data known at compile time.
To create a SFLV Button:
1.) Take the button from the Tester Viewer; right click, select Set from LV
2.) After Selecting SFLV; The button goes blank. Then a left click selects from the available Local Variables. Choose the appropriate.
3.) For A Frequency SFLV, the Target Value must be set to insure the proper cal information is selected at compile
4.) Selecting Target Value brings up a dialog to enter the estimated frequency