Skip to content

GenericDevice#

The generic 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.


property DeviceClass#

Gets the class of the device.

Returns#

Type Description
string The class of the device.

property DeviceTypeCaption#

Gets the type description for the device.

Returns#

Type Description
string The type description for the device.

property Guid#

Gets the unique identifier for this device.

This property can be used to get a specific device from Measmatic's device manager. The GUID is created when the device is to device manager and persists also between restarts of Measmatic.

Returns#

Type Description
string The unique identifier for this device as UUID.

property IdentificationCaption#

Gets a human-readable identifier for the device.

The property is created from the device's response on *IDN? and only is available

Returns#

Type Description
string A human-readable identifier for the device.

property IdentificationRawString#

Gets the device response on *IDN?

This property only is populated if *IDN? was issued during device initialization.

Returns#

Type Description
string The device response on *IDN? .

property Name#

Gets the name of the device.

Returns#

Type Description
string The name of the device.

method Query(request: string)#

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
string 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 ReceiveBinary(numberOfBytes: int)#

Reads a specified number of bytes from the input buffer of the device.

Available since Measmatic 2.3.25

Parameters#

Name Description
numberOfBytes The number of bytes to read.

Returns#

Type Description
bytes The bytes that were read from the device.

Example#

Reads 10 bytes from the device

responseBytes = device.ReceiveBinary(10)


method ReceiveLine()#

Reads one line from the input buffer of the device

Returns#

Type Description
string 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.ReceiveLine


method SendLine(request: string)#

Sends a command to the device.

The line is automatically terminated by the termination character configured in Measmatic device manager.

Parameters#

Name Description
request The string that is sent to the device.

Example#

Send *RST to the device

device.SendLine("*RST")