Skip to content

TestInterface#

Test execution interface for python scripts

An object of this type is passed to each python function Measmatic calls during test execution.


property BaseDirectory#

Gets the Measmatic base directory.

This directory contains all files Measmatic uses during test execution. That includes the tests, export filter, project files, data files, device configurations and more. The default value is C:\Measmatic . The directory is set once during setup when Measmatic is installed for the first time on a machine.

Returns#

Type Description
string The Measmatic base directory.

property DataFileDirectory#

Gets the Measmatic data file directory.

This directory is intended to be used for Measmatic data files in mmdat format.

Returns#

Type Description
string The Measmatic data file directory.

property Test#

Gets a reference to the test which is executing.

Refer to Test for all properties of this class.

Returns#

Type Description
DataTable The test which is executing.

method GetDevice(identification: string)#

Returns the device found for the specified identification

Parameters#

Name Description
identification The identification for the device. This can be the name of the device or the id of the device selector control in the test UI.

Returns#

Type Description
object The device.

method GetInputBool(controlId: string)#

Gets a boolean value that was defined in test user interface

If the control id does not exist or the input is not of boolean type an error will be raised.

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
bool The value

Example#

Gets the value set in a checkbox in the test user interface

is_checked = measmatic.GetInputBool('checkbox-control-id')


method GetInputFloat(controlId: string)#

Gets a float value that was defined in test user interface

If the control id does not exist or the input is not of type float an error will be raised.

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
float The value as float

Example#

Gets the value set in an input in the test user interface

voltage = measmatic.GetInputFloat('input-control-id')


method GetInputInt(controlId: string)#

Gets an integer value that was defined in test user interface

If the control id does not exist or the input is not of type integer an error will be raised.

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
int The value as integer

Example#

Gets the value set in an input in the test user interface

points = measmatic.GetInputInt('input-control-id')


method GetInputString(controlId: string)#

Gets an integer value that was defined in test user interface

If the control id does not exist or the input is not of type integer an error will be raised.

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
int The value as integer

Example#

Gets the value set in an input in the test user interface

iterations = measmatic.GetInputInt('input-control-id')
for n in range(0, iterations):
    print(n)


method GetSiteInfo()#

Gets the position the chuck is positioned on

Returns#

Type Description
int The column of the die the chuck is positioned on
int The row of the die the chuck is positioned on
int The subsite's index of the die the chuck is positioned on
string The subsite's label of the die the chuck is positioned on

Example#

Get the site information and print it to log:

column, row, subsite_index, subsite_label = measmatic.GetSiteInfo()
print("Column: {0}, Row: {1}, Subsite index: {2}, Subsite label: {3}".format(column, row, subsite_index, subsite_label))


method GetTest(testName: string)#

Returns the test with the name from the current project.

If no test with the given name exists, none is returned.

Parameters#

Name Description
testName The test's name

Returns#

Type Description
The test with the desired name

method GetTestByGuid(testGuid: string)#

Returns the test with the specified unique identifier (GUID) from the current project.

If no test with the given unique identifier exists, none is returned.

Parameters#

Name Description
testGuid The test's unique identifier

Returns#

Type Description
The test with the desired unique identifier

method LoadData(mmdatFilePath: string)#

Loads the data from a Measmatic data file in mmdat format and returns its content as object of type DataExport.

Parameters#

Name Description
mmdatFilePath The path to the Measmatic data file in mmdat format.

Returns#

Type Description
The data.

method SetMeasurementChannel(measurementChannel: int)#

Sets the measurement channel the following measurement data is assigned to.

Parameters#

Name Description
measurementChannel The measurement channel the following measurement data is assigned to.

Example#

Sets the measurement channel to 42:

measmatic.SetMeasurementChannel(42)


method SetPinName(pinName: string)#

Sets the name for the pin under test. All following measurement data stored to measmatic will be assigned to this pin name.

Parameters#

Name Description
pinName The name of the tested pin

Example#

Set pin name and store data assigned to that pin:

measmatic.SetPinName("DUT 1")
measmatic.StoreData("voltage", voltage)


method SetSiteInfo(siteColumn: int, siteRow: int, subSiteIndex: int, subSiteLabel: string)#

Sets the position the chuck is positioned on

Parameters#

Name Description
siteColumn The column of the die the chuck is positioned on
siteRow The row of the die the chuck is positioned on
subSiteIndex The subsite's index of the die the chuck is positioned on
subSiteLabel The subsite's label of the die the chuck is positioned on

Example#

Sets the site information to column -3 and row 4:

measmatic.SetSiteInfo(-3,4)


method SetTestResult(result: string)#

Sets the test result to pass or fail.

Parameters#

Name Description
result The result the test should have: pass or fail.

Example#

Sets the result of the test to failed

measmatic.SetTestResult("fail")


method StoreData(parameterName: string, parameterValue: string)#

Stores a string as result data for the given test parameter.

Parameters#

Name Description
parameterName The parameter's name for which the string is stored
parameterValue The actual value to be stored

Example#

The following example shows how a string is stored as measurement data. It's assumed that the test has an output parameter named Response defined.

device = measmatic.Getdevice('device-control-id')
response = device.Query("*IDN?")
measmatic.StoreData('Response', response)


method StoreData(parameterName: string, parameterValue: float)#

Stores a float value as measurement data for the given test parameter.

Parameters#

Name Description
parameterName The parameter's name for which the float value is stored for
parameterValue The actual value to be stored

Example#

The following example shows how a measurement value like voltage is acquired and the resulting value is stored as output parameter data.

smu = measmatic.GetDevice('device-smu')
voltage = smu.MeasureVoltage()
measmatic.StoreData('voltage', voltage)


method StoreData(parameterName: string, parameterValue: bool)#

Stores a boolean value as measurement data for the given test parameter.

Parameters#

Name Description
parameterName The parameter's name for which the boolean value is stored
parameterValue The actual value to be stored

Example#

The following example shows how a boolean value is stored as measurement data. It's assumed that the test has an output parameter named DidMeasureVoltage defined.

measmatic.StoreData('DidMeasureVoltage', True)


method StoreData(parameterName: string, parameterValue: list of float)#

Stores an array of floats as measurement data for the given test parameter.

Parameters#

Name Description
parameterName The parameter's name for which the array of floats is stored for
parameterValue The actual value to be stored

Example#

The following example shows how different measurement values like voltages are acquired over time and the resulting values are stored as array of floats to the output parameter data.

import time

smu = measmatic.GetDevice('device-smu')
voltages = []
for t in range(1, 10):
    voltage = smu.MeasureVoltage()
    voltages.append(voltage)
    time.sleep(t)

measmatic.StoreData('voltages', voltages)