Test controller, Interface definition

This page contains concrete recommendations for #interface definitions depending on device. I have split it into sections:I will not show the actual implementation of the different interfaces here, check some device definitions to see examples.
If a device do not support a specific function, do not implement a dummy version of the interface, just leave it out.
It is always accepted to implement more #interface definition than listed here, as long as they follow the same style of names and functions.
This list will be expanded over time.
#interface is not mandatory for a driver to implement, but if it is missing the device may not be supported everywhere in TC.
The second purpose of #interface definitions is for people that makes script to be fairly independent of actual device used, i.e. a script can work with most devices of the same type without changes.
#interfaceType is not mandatory for a driver to implement, but is useful for classifying the driver, it can be added without any #interface definitions.

Contents
    General rules
    DMM
        Primary DMM
        Secondary DMM
    Power
        Primary power
        Secondary power
        Tertiary power
    Power Supply
        Primary power supply
        Secondary power supply
        Tertiary power supply
    Load
        Primary load
        Secondary load
        Tertiary load
    AC supply, AC source
        Primary AC supply
        Tertiary AC supply
    Thermometer
        Primary thermometer
    Humidity
        Primary Humidity
    Relay
        Primary relay
        Secondary relay
        Tertiary relay
    Readout
        Primary readout
        Secondary readout
    Input
        Primary Input
    Output
        Primary Output
        Secondary output
    PWM
        Primary PWM
        Secondary PWM
    AInput
        Primary AInput
    AOutput
        Primary AOutput
        Secondary AOutput
        Tertiary AOutput
    Calibrator
        Primary Calibrator
        Secondary Calibrator
    RF generator
        Primary RF generator
        Secondary RF generator
    Notes
Main #interface manual
Main page

General rules

setOn() must not affect settings, only turn output on/off. I.e. this must be valid:
setVoltage(5);setOn(1); ...... setOn(0);setOn(1);...
Notice the output value is defined before the output is turned on and it will still be 5 volt after the second off/on cycle.
This is different from the #outputOff in the definition or setAllOff() here it is supposed to switch all outputs to off and if not possible turn them to 0.

For a device with multiple outputs or inputs the #interfaceType will contain a entry for each channel, like this:
#interfaceType relay relay:2 relay:3 relay:4 relay:5 relay:6 relay:7 relay:8

For a device with a mix of functions the #interfaceType will contain a entry for each type, like this:
#interfaceType humidity thermometer
#interfaceType input, input:2, input:3, input:4, output:5, output:6, output:7, output:8
#interfaceType input, input:2, input:3, input:4, output, output:1, output:2, output:3
The two input/output defines the same number of input/outputs, but they are addressed different. In the first one a getInputs() and getOutputs() may return the same value that contains both input and outputs, in the second one they will only contain either input or output and the address and bit position of outputs will be from 0-3.

#interface setAllOff() can be used for all devices with outputs, it will turn all channels off or if not possible set them to 0 output. To recover from this used setOn(1) to turn each channel on again. Note: a setOn(1) must not turn all channels on after a setAllOff() only the specified channel. This may mean that setAllOff() will both turn off a master and each channel where setOn(1) turns of the master and a single channel and setOn(0) turns off a single channel, but do not change master.

Generally scripts and popups are supposed to check if a specific #interface exist before calling it. For scripts saved as menu, it is possible to list required #interface's at the top and the script will only be visible if a device is loaded that supports it.

Values are always in basic SI units, it is never specified in mA or kohm, that conversion must be done in the definition or the device itself.



DMM

A multimeter is very simple:
#interfaceType DMM
If it is a multimeter that can be computer controlled use:
#interfaceType DMM BMM

Primary DMM
Secondary DMM

Power

This is a power meter, it may be able to measure both AC and DC power, it is defined as:
#interfaceType Power
Power meters are fairly complex meters and often makes it possible to configure what they read, this do not work well with #interface. One way around that is to always defined the first 3 measurement as voltage current and power.

Primary power
Secondary power
Tertiary power


Power Supply

TC uses ps as type for power supplies.
for a single channel power supply this means:
#interfaceType ps
For a 3. channel power supply use this (This will affect all #interface definitions):
#interfaceType ps ps:2 ps:3

Primary power supply
Secondary power supply
Tertiary power supply


Load

A electronic load will use this type definition:
#interfaceType load
A duel channel load will use (This will affect all #interface definitions):
#interfaceType load load:2

Primary load
Secondary load
Tertiary load


AC supply, AC source

TC uses acps as type for AC power supplies, for a single channel AC power supply this means:
#interfaceType acps

Primary AC supply
Tertiary AC supply


Thermometer

A single channel thermometer will have this type:
#interfaceType thermometer
For more channels do this (Example is four channel):
#interfaceType thermometer thermometer:2 thermometer:3 thermometer:4

Primary thermometer


Humidity

A humidity sensor will have this interface type:
#interfaceType humidity
It returns humidity in percent.
It will often also include a thermometer and they are allowed to share a channel, i.e. this is valid:
#interfaceType humidity thermometer

Primary Humidity


Relay

A single channel relay will be:
#interfaceType relay
But most relay interfaces are multichannel (Here a 8 channel):
#interfaceType relay relay:2 relay:3 relay:4 relay:5 relay:6 relay:7 relay:8

Primary relay
Secondary relay
Tertiary relay


Readout

This is a single line display with a couple of digits that can be used to echo a value from testController.
Each digits is handled as a device, this makes it possible to address them individually.
Depending on function the device id specifies first digit that is affected, most functions will affect multiple digits.

For a 6 digit readout it will be:
#interfaceType readout readout:2 readout:3 readout:4 readout:5 readout:6


Primary readout
Secondary readout


Input

Digital input that only detect two levels.
The return value is 0 or 1 for readIput, where 0=low=off, 1=high=on

Primary Input


Output

This is a digital output and similar to relays, but will deliver a voltage or current output when on (Relay is a switch that is on or off).
The setOn is only needed if device support on/off, just setting the output to zero is not acceptable. The #outputOff in the definition is supposed to switch all outputs to zero or turn them completely off.

Primary Output
Secondary output


PWM

This is a device with controlled PWM output. Output can be either a voltage, current or a switched output (i.e. OC).

Primary PWM
Secondary PWM

AInput

Analog input, typical 0-10V or 0-20mA inputs, but can be other values.
Only one of the primary functions will usually be defined.

Primary AInput


AOutput

Analog output, typical 0-10V or 0-20mA outputs, but can be other values.
If the device can switch between voltage/current it will switch when the relevant set command is used. Devices with either voltage or current will only implement commands for that.
The setOn is only needed if device support on/off, just setting the output to zero is not acceptable. The #outputOff in the definition is supposed to switch all outputs to zero or turn them completely off.
Also remember current is always in ampere, it is never specified in mA, that conversion must be done in the definition or the device itself.

Primary AOutput
Secondary AOutput
Tertiary AOutput


Calibrator

Analog output with very precise levels, this will usually be one channel only and may support more output types that analog output
If the device can switch between output types it will switch when the relevant set command is used. Only commands for support output types will be present.
The setOn is only needed if device support on/off, just setting the output to zero is not acceptable. The #outputOff in the definition is supposed to switch all outputs to zero or turn them completely off.
Also remember values are always in basic SI units, it is never specified in mA or kohm, that conversion must be done in the definition or the device itself.

Primary Calibrator
Secondary Calibrator



RF generator

Signal generator that can output variable frequencies in MHz and GHz range

Primary RF generator

Secondary RF generator

Notes

*These #interface definition may be redefined at a later data