Test controller, scripts for device configuration

Scripts in TC has many uses, on this page I will show how to use it for device configuration without writing any script by yourself. I will also give an example on how to step through a couple of settings based on time, this will require some minimal editing of a generated script.

Contents
    Preparing
    Generating the commands
    Generating the script
        In the log window
        As menu
        Grid panel
    Configuring multiple devices at the same time
    Generate time based setting changes
Main page



Preparing

TestController maintains a internal list of used commands that is used to generate a script, before starting to generate a script it is best to clear this list.

This clearing can be done by restarting TestController, or by using this menu item:

ClearingCommands

The "Mode & setup" menu will only be present if there are saved commands.



Generating the commands

To generate the configuration commands open the mode and/or setup menu for the device and send the commands. To generate a command for a already set value, press set to set it again.

CmdsPage1

CmdsPage2

In this case I adjusted two settings: current and hardware OPP, but any number of settings can be adjusted.



Generating the script

The script can be either generated in the log window or directly as a menu entry.



In the log window

GettingCommands1

Selecting "In log window" will clear the log window and put the script into it:

GettingCommands1a

In this case it is only two commands and then a #SyncPopups that forces any open setup popup windows to resynchronize to the actual settings on the device.

The commands in the log window can directly be used by pressing the "Run" button, they can also be saved by using the save button:

SavingCommands

Either to a file or as a menu (Same as below).
The file can be used from the "Load and run" button.

For very easy access the commands can be assign them to a function key:

Fkeys

Mark the area and right click. This is not saved as a script, but will be processed by the actual command line with the same restriction as exist for manually typed commands.


Another way to use the script is in Grid panel, see below.



As menu

Saving a script as a menu makes it fast to run it at any time.

GettingCommands2

When selecting either of the menu options a menu name must be provided. Using ; will create sub-menus and it is strongly recommended to do that.

GettingCommands2a

The above name creates the following menu entry, selecting it will run the script directly.

GettingCommands2b

The last option "Save as menu and edit" is similar to the above, but will finish by opening a editor with the script to allow editing.

GettingCommands3




Grid panel

Scripts can be added to the "Grid panel", not only configuration scripts, but any type of script.

One or more script panels must be added, each panel can contain multiple scripts:

GridMenuScript

In the panel popup menu a script must be added, the source can be a menu item, a file or a couple of scripts lines. In this case a couple of lines will be used, this is called "direct script"

GridMenuScript1

Adding a direct script requires a name for the button and the script lines (The script lines are manually copied from the log windows):

GridMenuScript2

And a button is added to the panel, press it to run the script.

GridMenuScript3

When making advanced "Grid panels" it is usually a good idea to save them, "As menu" is usually the best options for that. This will save the full "Grid panel" with all panels created on it including their configuration.

GridMenuScript4



Configuring multiple devices at the same time

It is possible to configure multiple devices at the same time:

Multi1
Multi2
Multi3

With the above commands the following script is generated:

MultiCmds1

It can be saved and used like in the first example.

If there are many devices it is possible to generate a script that will configure all devices at the same time, this makes the configuration faster, but the #SyncPopups may negate some of the extra speed, because it will update the popups in sequence (If they are open).

Multi6

With optimize checked the #async command is used to parallelize the commands for the different devices:

MultiCmds2

Due to a bug in TZ this option cannot be selected in the current version, but will be available from V2.50



Generate time based setting changes

For testing with different input voltages or different loads a step sequence can be used, this is easy to generate with a script.
See also Param sweper for another way to test with varying parameters.

First use the setup menu to generate multiple settings:

Multi3

Save them to the log window, here I have generated the following commands:
If generating for multiple devices, do not use the optimize option.

Code:
HMC8043:INST OUT2
HMC8043:VOLT 5.0
HMC8043:INST OUT2
HMC8043:CURR 1.0
HMC8043:INST OUT2
HMC8043:VOLT 4.5
HMC8043:INST OUT2
HMC8043:VOLT 5.5
HMC8043:INST OUT2
HMC8043:VOLT 6.0
HMC8043:INST OUT2
HMC8043:CURR 2.0
#SyncPopups

The above is not a practical script because it will run through all settings in less than a second.
But using the #delay command will fix that:

Code:
HMC8043:INST OUT2
HMC8043:VOLT 5.0
HMC8043:INST OUT2
HMC8043:CURR 1.0
#delay 3
HMC8043:INST OUT2
HMC8043:VOLT 4.5
#delay 3
HMC8043:INST OUT2
HMC8043:VOLT 5.5
#delay 3
HMC8043:INST OUT2
HMC8043:VOLT 6.0
#delay 3
HMC8043:INST OUT2
HMC8043:CURR 2.0
#SyncPopups

In the above I uses a 3 second delay between each change of setting, but any delay can be specified.
Again the final script can be saved as a menu, a file or used on the "Grid panel".