Testplans often use arrays to represent tests which are related, such as sweeps of voltage or frequency. When it becomes necessary to use programmer-supplied constant values in such a testplan, there is an easy way to enter and maintain the constants as an array. The technique described in this note makes it easy to create and maintain constant arrays while exploiting the simplicity of array calculations in the RI System Software.
The constants used in a testplan must be held somewhere. The easiest place to hold them is in a software object used for providing calibration offsets for "device interface" boards, the Device Interface object. To illustrate this technique, let's begin with a simple testplan. This testplan measures an array of 20 voltages and saves the data in a local variable:
The measurement isn't important -- it is only an example of how an array of measurement data might be created. Note that there are 20 measurement points and thus the local variable "X" will be an array of length 20. In the next panel, we use this measurement array along with constant values of our own:
Again, for purposes of illustration we have created a calculation that uses the measurement data (local var "X") and an array of constants we created ("My array") to perform a data reduction step. In this case we are subtracting an expected value for X from each point and summing the absolute value of the difference. This gives a simple measure of "distance" between the measured and expected value of X, which can then be limit checked and saved to the data log. Note the "cal factor" button above has an "owner" of Dut Interface. When you paste the button from the tester view, it will have an owner of System, which must be changed using the right-mouse-button menu selection "Change owner".
How do we get the values into our array of constants? We store the array in a calibration entry in a Device Interface object created for this purpose. First, create a new Device Interface object, or select one that will be used with the testplan. Point to the icon and select "Edit" from the right-mouse-button menu.
From the edit window of the Device Interface, select the "Inspect" button for the calibration data. This is where we will store our constant array. The calibration data inspector provides a convenient interface to create and edit our constant array.
Before we can enter our array, we must first create a name for it. Point to the left hand pane and select the right-mouse-button menu. Choose "Add Item" to create a new data item which will store our constant array.
This name will represent the constant data in the testplan. The name may contain spaces.
Once the name is created, we are permitted to associate an object with it. For general-purpose calculations we recommend using the data type "RiRealD". Delete any characters in the right-hand pane and type in the line as shown. Upper and lower case characters ARE significant, as is the colon character after "new". We are creating this array with a size of 20 which matches our measured data length in our example testplan. VERY IMPORTANT: After typing in this text, highlight it with the mouse, click the right button and choose "Save" to make the change permanent. Once saved, the Cal Table inspector shows a view like this:
When first created, the values in the array default to all "0.0" values. To change the values, double-click (left button) on the name "My array" and open the array inspector window.
From this window you can choose each element and change its value. Click on "1" and see the value of the first element of the array. Click on its value, "real RiRealD(1.0)", and the system will permit you to change it. Choose each element in the array and customize the values. When you are finished, just close the window, its parent window, and the Device Interface editor window. When closing the Device Interface editor, choose "OK" if you want to keep your edits or "Cancel" if you want to abort your changes and revert to the original object.
When running the testplan, be sure to select the Device Interface object that holds your custom data. It may be a good idea to define the testplan to require the Device Interface object so that you will get a warning message if the testplan is run without its special Device Interface.