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_stop_requested#
Queries if test execution shall be stopped.
Returns#
| Type | Description |
|---|---|
| bool | Returns True if test shall be stopped, otherwise False . |
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. |
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 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 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_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. |
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 |
|---|---|
| object | The device. |
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 |
|---|---|
| object | THe value as object. |
method get_input_string(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 |
|---|---|
| str | The value as integer |
Example#
Gets the value set in an input in the test user interface
iterations = measmatic.get_input_int('input-control-id')
for n in range(0, iterations):
print(n)
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 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 reset_bin_code()#
Removes the bin code from test metadata in case it was set before.
method set_bin(binCode: int, binDescription: str, isFailBin: bool)#
Sets the bin for the current measurement.
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. |
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_parameter_result(parameterName: str, isTestPassed: bool)#
Sets the result for a specific parameter
Parameters#
| Name | Description |
|---|---|
| parameterName | The name of the parameter. |
| isTestPassed | True , if the test passed, otherwise False . |
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 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_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_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_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)