TestController, scripting example

Running

The TestController supports scripting, at the current time it is very simple, but can still be useful.
I will do this example with the virtual ramp generator, but it could also have been a electronic load for a battery tests.

This example requires V0.14 or newer of the software.

Contents
    Selecting the virtual ramp generator
    Turning off at specific value
    Logging and turning off at specific value
    Logging and turning off at specific value or time


Selecting the virtual ramp generator

SetupVRG

First the virtual ramp generator must be added to your hardware list: Select it, add it and check that it is the only hardware enabled. Finally press reconnect.

SelectVRG

Next change to the command window and select it. When more than one piece of equipment is active this select what item will receive commands and can be configured from the software.

Selected

With the VRG selected the configuration is available. This selection is only valid for the command line, not for scripts!

Popup

The VRG setup menu. For this example I will use the default values.



Turning off at specific value

Script1

The TestController can be used as a editor in the log window. Here I have written a 3 line script.
I use "VRG:" before the commands to the device, because the script do not use the currently selected device for the command line. The VRG.Range name can be found in "Current values" or in the Table/Chart/Range/etc. after logging some values.
Pressing Run will start the script. It will run in the background and not prevent using commands or the setup menu.

Script2

The output from the script is shown in the log window and it will stop at the #wait command for some time.

Script3

When the ramp generator output reach 5 it will stop and turn the ramp generator off.
If the logging is started before the script, it is possible to see the result.



Logging and turning off at specific value

By adding logging to the above example it is possible to see the result, logging could also have been controlled manually.

ScriptLog1

The program needs a command to start logging, I have added at delay at the end, before stopping logging. This makes it possible to see the result from turning the generator off

ScriptLog2

When running the log window will show the commands and the buttons will reflect that both logging and a script is active.
It is possible to check the other windows while the script and log is running.

ScriptLog3

Generator is off, but logging and script will continue for 5 seconds more.

ScriptLog4

Script and logging is done.

ScriptLog5

The resulting log, it can also be viewed in the table or the range format.



Logging and turning off at specific value or time

The #wait command can have more than one condition.

ScriptLog6

Here both time and value. With the default settings for the ramp generator it will stop on time, but by using the setup menu and change the output levels it is possible to stop it earlier.

The script can be saved with the "Save" button and later run again with the "Load and run" button.



Conclusion

This is fairly simple scripting, but can be very useful together with an electronic load to test batteries or power supplies.