MeasmaticDevice#
The Measmatic device class enables communication with any device that can be controlled using TCP/IP, GPIB or RS232. The class provides functionality for sending and receiving commands to the device. It is the base class for all device classes that are internal to Measmatic. For custom devices that are defined by Python scripts, the base class is Device.
property device_class#
Gets the class of the device.
Returns#
| Type | Description |
|---|---|
| str | The class of the device. |
property device_type_caption#
Gets the type description for the device.
Returns#
| Type | Description |
|---|---|
| str | The type description for the device. |
property guid#
Gets the unique identifier for this device as UUID.
Returns#
| Type | Description |
|---|---|
| str | The unique identifier for this device as UUID. |
property identification_caption#
Gets a human-readable identifier for the device.
Returns#
| Type | Description |
|---|---|
| str | A human-readable identifier for the device. |
property identification_raw_string#
Gets the device response on *IDN?
Returns#
| Type | Description |
|---|---|
| str | The device response on *IDN? . |
property name#
Gets the name of the device.
Returns#
| Type | Description |
|---|---|
| str | The name of the device. |
method query(request: str)#
Sends a query to the device and returns its response.
Parameters#
| Name | Description |
|---|---|
| request | The string that is sent to the device. |
Returns#
| Type | Description |
|---|---|
| str | The device response on the request. |
Example#
Sends *IDN? to the device and puts the response into the variable response
response = device.query("*IDN?")
method receive_binary(number_of_bytes: int)#
Reads a specified number of bytes from the input buffer of the device.
Parameters#
| Name | Description |
|---|---|
| number_of_bytes | The number of bytes to read. |
Returns#
| Type | Description |
|---|---|
| byte | The bytes that were read from the device. |
Example#
Reads 10 bytes from the device
response_bytes = device.receive_binary(10)
method receive_line()#
Reads one line from the input buffer of the device.
Returns#
| Type | Description |
|---|---|
| str | The first line of the device's input buffer. |
Example#
Reads the first line of the response from the last request that was sent to the device.
response = device.receive_line()
method send_binary(data_bytes: list[byte])#
Sends the specified byte array to the device.
Parameters#
| Name | Description |
|---|---|
| data_bytes | The bytes to send. |
Example#
Sends "Hello World!" as UTF-8 encoded bytes to the device
hello_world = bytearray("Hello World!", 'utf-8')
device.send_binary(hello_world)
method send_line(request: str)#
Sends a command to the device.
Parameters#
| Name | Description |
|---|---|
| request | The string that is sent to the device. |
Example#
Send *RST to the device
device.send_line("*RST")
method adelay(numberOfPoints: int, delays: list[float])#
This command specifies an array of delay points to use with asweepX command calls.
Parameters#
| Name | Description |
|---|---|
| numberOfPoints | The number of separate delay points defined in the array |
| delays | The name of the array defining the delay points; this is a single-dimension |
method asweepi(instrId: int, numberOfPoints: int, delay: float, forceArray: list[float])#
This command generates a current waveform based on a user-defined forcing array. The asweepX command is used with the smeasX, sintgX, or savgX commands.
Parameters#
| Name | Description |
|---|---|
| instrId | The instrument identification code of the sourcing instrument |
| numberOfPoints | The number of separate current and voltage force points defined in the array (1...4096) |
| delay | The delay, in seconds, between each step and the measurements defined by the |
| forceArray | this is a single dimension array that contains all force points |
method asweepv(instrId: int, numberOfPoints: int, delay: float, forceArray: list[float])#
This command generates a voltage waveform based on a user-defined forcing array. The asweepX command is used with the smeasX, sintgX, or savgX commands.
Parameters#
| Name | Description |
|---|---|
| instrId | The instrument identification code of the sourcing instrument |
| numberOfPoints | The number of separate current and voltage force points defined in the array (1...4096) |
| delay | The delay, in seconds, between each step and the measurements defined by the |
| forceArray | this is a single dimension array that contains all force points |
method avgi(instrId: int, stepno: int, steptime: float)#
This command makes a series of current measurements and averages the results.
Parameters#
| Name | Description |
|---|---|
| instrId | The instrument identification code of the sourcing instrument |
| stepno | The number of steps averaged in the measurement (1 to 32,767) |
| steptime | The interval in seconds between each measurement; the minimum practical time is approximately |
Returns#
| Type | Description |
|---|---|
| The measurement result. |
method avgv(instrId: int, stepno: int, steptime: float)#
This command makes a series of voltage measurements and averages the results.
Parameters#
| Name | Description |
|---|---|
| instrId | The instrument identification code of the sourcing instrument |
| stepno | The number of steps averaged in the measurement (1 to 32,767) |
| steptime | The interval in seconds between each measurement; the minimum practical time is approximately |
Returns#
| Type | Description |
|---|---|
| The measurement result. |
method bmeasi(instrId: int, numrdg: int, delay: float, timerid: int, result: System.Double[]@, timerdata: System.Double[]@)#
This command makes a series of current readings as quickly as possible. This measurement mode allows for waveform capture and analysis(within the resolution of the measurement instrument).
Parameters#
| Name | Description |
|---|---|
| instrId | The instrument identification code of the measuring instrument |
| numrdg | The number of readings to return in the array |
| delay | The delay between points to wait (in seconds) |
| timerid | The device name of the timer to use (0 = no timer data) |
| result | The measurement readings. |
| timerdata | The array used to receive the time points at which the readings were made; if timerID = 0, the |
method bmeasv(instrId: int, numrdg: int, delay: float, timerid: int, result: System.Double[]@, timerdata: System.Double[]@)#
This command makes a series of voltage readings as quickly as possible. This measurement mode allows for waveform capture and analysis(within the resolution of the measurement instrument).
Parameters#
| Name | Description |
|---|---|
| instrId | The instrument identification code of the measuring instrument |
| numrdg | The number of readings to return in the array |
| delay | The delay between points to wait (in seconds) |
| timerid | The device name of the timer to use (0 = no timer data) |
| result | The measurement readings. |
| timerdata | The array used to receive the time points at which the readings were made; if timerID = 0, the |
method clrscn()#
This command clears the measurement scan tables associated with a sweep.