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 base_directory#

Gets the Measmatic base directory.

Returns#

Type Description
str The Measmatic base directory.

property data_file_directory#

Gets the Measmatic data file directory.

Returns#

Type Description
str The Measmatic data file directory.

property is_all_run#

Queries if the current measurement executes all tests of the test list.

Returns#

Type Description
bool Returns True if all tests are executed, otherwise False .

property is_remote_run#

Queries if the current measurement was started via a remote control interface.

Returns#

Type Description
bool Returns True if the measurement was started remotely, otherwise False .

property is_single_run#

Queries if the current measurement executes a single test only.

Returns#

Type Description
bool Returns True if a single test is executed, otherwise False .

property is_stop_requested#

Queries if test execution shall be stopped.

Returns#

Type Description
bool Returns True if test shall be stopped, otherwise False .

property measurement_description#

Gets an object with metadate of the current measurement.

Returns#

Type Description
MeasurementDescription The measurement description object with metadata of the current measurement.

property project_path#

Gets the path of the currently loaded project file.

Returns#

Type Description
str The path of the project file.

property project_settings#

Gets the settings of the current project.

Returns#

Type Description
ProjectSettings The project settings object.

property python_test_path#

Gets the directory that contains the legacy Python tests.

Returns#

Type Description
str The legacy Python tests directory.

property script_device#

Gets the device on which Lua scripts are executed (the main script device).

Returns#

Type Description
Any The first Keithley TSP master device of the project (.NET type IKeithleyTspDevice ), or None if
there is none or the lookup failed.

property storage#

Persistent storage for global test data which is valid during the whole project execution.

Returns#

Type Description
DataStorage An object for persistent storage for global test data.

property test#

Gets a reference to the test which is executing.

Returns#

Type Description
Test The test which is executing.

property test_name#

Gets the name of the test which is executing.

Returns#

Type Description
str The name of the test.

method adapter_pin_to_machine_pin(adapterPin: str)#

Returns the machine pin that belongs to the given adapter pin.

Parameters#

Name Description
adapterPin The name of the adapter pin.

Returns#

Type Description
int The number of the corresponding machine pin.

Example#

machine_pin = measmatic.adapter_pin_to_machine_pin('A1')

method append_data(parameterName: str, parameterValue: float)#

Appends the measured value to an existing array of float values.

Parameters#

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

method append_data_to_row(parameterName: str, rowIndex: int, parameterValue: float)#

Appends the measured value to a data row selected by index, creating the row if it does not exist yet.

Parameters#

Name Description
parameterName The parameter's name for which the measured value is stored.
rowIndex The zero-based index of the data row the value should be appended to. May equal the current row count to
parameterValue The value to be appended to the data row.

Example#

Appends a measured voltage value to the first data row with pin name DUT1:

data_table = measmatic.test.data_table
for row_index in range(data_table.row_count):
row = data_table.get_row(row_index)
if row.pin_name == 'DUT1':
measmatic.append_data_to_row('voltage', row_index, voltage)
break

method check_device_selected(device_select_id: str, device_name: str = '')#

Checks if a device is selected in the device selector control with the given identification. If no device is selected, an exception is thrown.

Parameters#

Name Description
device_select_id The data-id of the device selector control in the test UI which should be checked for a selected device.
device_name Optional name of the device which should be selected, used for a more specific exception message if no device is Default: ''

method delay(seconds: float)#

Suspends test execution. (can be interrupted by stop signal)

Parameters#

Name Description
seconds The time in seconds to wait.

Returns#

Type Description
bool True if stop signal occurred during wait, otherwise False .

method execute_sequence()#

Executes the child tests of the current test if it is a sequence test.


method execute_sorting()#

Evaluates the results and determines the bin for the current run of the project right now, using the project's sorting settings.

Example#

measmatic.execute_sorting()

method get_all_tests()#

Returns all tests that are currently in the project.

Returns#

Type Description
Test All tests that are currently in the project.

method get_bin()#

Returns the current bin if already set or None if not set yet.

Returns#

Type Description
SortingBin The current bin, or None if no bin was assigned yet.

Example#

bin = measmatic.get_bin()
if bin is not None:
print(bin.bin_number)

method get_bin_code()#

Returns the numeric code of the bin for the current measurement.

Returns#

Type Description
int The numeric code of the bin for the current measurement, or None if no bin
was assigned yet. A bin without a number returns the project's number for
unnumbered bins (NoBinNumber setting, -1 by default).

method get_cluster_info(clusterIndex: int)#

Returns the cluster information of the current measurement for a specific cluster index.

Parameters#

Name Description
clusterIndex The cluster index for which the cluster information is requested.

Returns#

Type Description
Any The cluster information (.NET type Atv.Framework.Models.Prober.ClusterInfo ), or None if there
is none for the given index.

Example#

info = measmatic.get_cluster_info(0)

method get_cluster_infos()#

Returns all cluster information of the current measurement.

Returns#

Type Description
Any The list of cluster information (.NET type List<ClusterInfo> ), or None if there is none.

Example#

infos = measmatic.get_cluster_infos()

method get_device(identification: str)#

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

Returns#

Type Description
Any The device.

method get_device_channel(deviceChannelName: str)#

Returns the device channel with the given name.

Parameters#

Name Description
deviceChannelName The name of the device channel.

Returns#

Type Description
Any The device channel (.NET type IDeviceChannel , not wrapped in a Python proxy).

Example#

channel = measmatic.get_device_channel('smu1-channel-a')

method get_device_name_as_variable(deviceName: str)#

Returns the Lua variable name for the given device or device channel.

Parameters#

Name Description
deviceName The name of the device or device channel.

Returns#

Type Description
str The variable name used for the device in Lua scripts.

Example#

variable = measmatic.get_device_name_as_variable('smu1')

method get_device_of_type(deviceName: str)#

Returns the device with the given name of the given type.

Parameters#

Name Description
deviceName The device name.

Returns#

Type Description
Any The device as Python proxy.

method get_input(id: str)#

Returns the GUI control element with the given ID.

Parameters#

Name Description
id The GUI control ID.

Returns#

Type Description
Any The value of the control converted to a Python object, or None if the test has no HTML user interface.

method get_input_bool(controlId: str)#

Gets a boolean value that was defined in test user interface

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.get_input_bool('checkbox-control-id')

method get_input_float(controlId: str)#

Gets a float value that was defined in test user interface

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.get_input_float('input-control-id')

method get_input_int(controlId: str)#

Gets an integer value that was defined in test user interface

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.get_input_int('input-control-id')

method get_input_object(control_id: str)#

Gets an object value that was defined in test user interface.

Parameters#

Name Description
control_id The identifier of the control in the test user interface.

Returns#

Type Description
Any THe value as object.

method get_input_string(controlId: str)#

Gets a string value that was defined in test user interface

Parameters#

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

Returns#

Type Description
str The value as string

Example#

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

stringValue = measmatic.get_input_string('input-control-id')
print(stringValue)

method get_machine_pins(groupName: str)#

Returns a list of all machine pins that belong to the pin group with the given name.

Parameters#

Name Description
groupName The name of the pin group.

Returns#

Type Description
Any The machine pins (.NET type List<MachinePin> ).

Example#

pins = measmatic.get_machine_pins('Group1')

method get_site_info()#

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
str 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.get_site_info()
print("Column: {0}, Row: {1}, Subsite index: {2}, Subsite label: {3}".format(column, row, subsite_index, subsite_label))

method get_test(testName: str)#

Returns the test with the name from the current project.

Parameters#

Name Description
testName The test's name

Returns#

Type Description
Test The test with the desired name

method get_test_by_guid(testGuid: str)#

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

Parameters#

Name Description
testGuid The test's unique identifier

Returns#

Type Description
Test The test with the desired unique identifier

method get_tsp_device_config_item(name: str)#

Returns the configuration of a Keithley TSP device with the given name.

Parameters#

Name Description
name The name of the TSP device configuration.

Returns#

Type Description
Any The configuration (.NET type KeithleyTspDeviceConfigurationBase ).

Example#

config = measmatic.get_tsp_device_config_item('tsp-device')

method hide_busy_indicator()#

Hides the busy indicator shown by show_busy_indicator .

Example#

measmatic.hide_busy_indicator()

method load_data(mmdatFilePath: str)#

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
DataExport The data.

method replace_space_holders(stringWithPlaceholders: str)#

Replaces all placeholders in the string with the values of the current project, test and measurement description.

Parameters#

Name Description
stringWithPlaceholders The string containing placeholders.

Returns#

Type Description
str The string with the placeholders replaced.

Example#

path = measmatic.replace_space_holders('C:\\images\\<PROJECT>_<TESTNAME>.png')

method reset_bin_code()#

Removes the bin code from test metadata in case it was set before. If the bin was set by the script, the binning via the sorting table takes over again when the rows are sorted.


method set_bin(binCode: int, binDescription: str, isFailBin: bool = False)#

Sets the bin for the current measurement. A bin set by the script wins: it is not overwritten by the binning via the sorting table.

Parameters#

Name Description
binCode The numeric code of the bin.
binDescription A string describing the bin.
isFailBin A value indicating if the bin represents a fail state. Default: false

method set_measurement_channel(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.set_measurement_channel(42)

method set_dut_index(dutIndex: int)#

Sets the index of the part (DUT) the following measurement data belongs to, for tests measuring several parts in one run without a prober or switch. Rows with different indexes are sorted (binned) as different parts; rows that differ only by pin name belong to the same part.

Parameters#

Name Description
dutIndex The index of the part the following measurement data belongs to.

Example#

Measures three parts in one run, each sorted on its own:

for dut_index in range(3):
measmatic.set_dut_index(dut_index)
measmatic.store_data_float("Resistance", measure(dut_index))

method set_param_result(parameterName: str, result: str, pin: Any = None)#

Sets the evaluation result for a value of the given parameter.

Parameters#

Name Description
parameterName The caption or name of the parameter.
result The result: "pass", "fail" or "undef".
pin Selects the row: none for the last row, an integer for a row index or a string for Default: None

Example#

Sets the result of the parameter "Voltage" in the last row to failed

measmatic.set_param_result("Voltage", "fail")

method set_parameter_result(parameterName: str, isTestPassed: bool)#

Sets the evaluation result for the value of the given parameter in the last row.

Parameters#

Name Description
parameterName The name of the parameter.
isTestPassed True , if the value passed, otherwise False .

method set_pin_name(pinName: str)#

Sets the pin name the following measurement data is assigned to.

Parameters#

Name Description
pinName The name of the pin.

Example#

measmatic.set_pin_name('Pin 1')
measmatic.append_data('voltage', voltage)

method set_pin_result(parameterName: str, result: Any, pin: str = None)#

Sets the evaluation result for a value of the given parameter, selecting the row by pin name.

Parameters#

Name Description
parameterName The name or caption of the parameter (the column).
result The evaluation result, a value of the .NET enumeration Atv.Measmatic.Data.DataTableValueResult .
pin The pin name of the row; none selects the last row. Default: None

method set_site_info(siteColumn: int, siteRow: int, subSiteIndex: int = 0, subSiteLabel: str = '')#

Sets the site information (die position) the following measurement data is assigned to.

Parameters#

Name Description
siteColumn The column of the die.
siteRow The row of the die.
subSiteIndex The index of the subsite. Default: 0
subSiteLabel The label of the subsite. Default: ''

Example#

measmatic.set_site_info(3, 5)

method set_test_result(result: str)#

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.set_test_result("fail")

method show_busy_indicator(message: str)#

Shows a busy indicator with a specified message.

Parameters#

Name Description
message The message shown next to the indicator.

Example#

measmatic.show_busy_indicator('Please wait...')

method show_hint(message: str)#

Shows a hint in the Measmatic main window.

Parameters#

Name Description
message The message.

Example#

measmatic.show_hint('Connect the probe cable')

method show_message_box(caption: str, message: str)#

Shows a message box with an OK button and waits until it is closed.

Parameters#

Name Description
caption The caption.
message The message.

Example#

measmatic.show_message_box('Setup', 'Connect the probe cable')

method show_ok_cancel_message_box(caption: str, message: str)#

Shows a message box with the options OK and Cancel and waits until it is closed.

Parameters#

Name Description
caption The caption.
message The message.

Returns#

Type Description
bool True , when the user hit OK, otherwise False .

Example#

if measmatic.show_ok_cancel_message_box('Setup', 'Continue with the measurement?'):
pass

method store_data_bool(parameterName: str, 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.store_data_bool('DidMeasureVoltage', True)


method store_data_bool_to_row(parameterName: str, rowIndex: int, parameterValue: bool)#

Stores a boolean value as measurement data in the data row selected by index, creating the row if it does not exist yet.

Parameters#

Name Description
parameterName The parameter's name for which the boolean value is stored.
rowIndex The zero-based index of the data row the value should be stored in. May equal the current row count to
parameterValue The actual value to be stored.

method store_data_float(parameterName: str, 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.get_device('device-smu')
voltage = smu.MeasureVoltage()
measmatic.store_data('voltage', voltage)

method store_data_float_array(parameterName: str, parameterValue: list[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.get_device('device-smu')
voltages = []
for t in range(1, 10):
    voltage = smu.MeasureVoltage()
    voltages.append(voltage)
    time.sleep(t)
measmatic.store_data_float_array('voltages', voltages)

method store_data_float_array_to_row(parameterName: str, rowIndex: int, parameterValue: list[float])#

Stores an array of floats as measurement data in the data row selected by index, creating the row if it does not exist yet.

Parameters#

Name Description
parameterName The parameter's name for which the array of floats is stored.
rowIndex The zero-based index of the data row the value should be stored in. May equal the current row count to
parameterValue The actual value to be stored.

method store_data_float_to_row(parameterName: str, rowIndex: int, parameterValue: float)#

Stores a float value as measurement data in the data row selected by index, creating the row if it does not exist yet.

Parameters#

Name Description
parameterName The parameter's name for which the float value is stored.
rowIndex The zero-based index of the data row the value should be stored in. May equal the current row count to
parameterValue The actual value to be stored.

method store_data_string(parameterName: str, parameterValue: str)#

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.get_device('device-control-id')
response = device.Query("*IDN?")
measmatic.store_data('Response', response)


method store_data_string_to_row(parameterName: str, rowIndex: int, parameterValue: str)#

Stores a string as measurement data in the data row selected by index, creating the row if it does not exist yet.

Parameters#

Name Description
parameterName The parameter's name for which the string is stored.
rowIndex The zero-based index of the data row the value should be stored in. May equal the current row count to
parameterValue The actual value to be stored.