VISA Equipment Base Class
VISAEquipment
Base class that represents an instance of a VISA-compliant device
Methods:
| Name | Description |
|---|---|
__init__ |
Create an instance of a VISA-compliant device using a given IDN_PATTERN |
configure |
Override this function to configure your particular device. |
find_device |
Find all resources attached to the host and select the first one that matches the IDN_PATTERN |
query |
Write a SCPI command to the device and then read the result |
read |
Read the device |
take_screenshot |
Override this function to take a screenshot of the display of your particular device |
write |
Write a SCPI command to the device |
__init__()
Create an instance of a VISA-compliant device using a given IDN_PATTERN to find the related instrument connected to the host. If found, it will then configure it for before the test runs
configure()
Override this function to configure your particular device. Used during initializing the class to get the device into a known state
find_device()
Find all resources attached to the host and select the first one that matches the IDN_PATTERN NOTE: this will select the first found device that matches, multiple of the same device is not supported
Returns:
| Type | Description |
|---|---|
bool
|
True when a matching instrument is found and selected, False otherwise |
query(SCPI)
Write a SCPI command to the device and then read the result
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
SCPI
|
str
|
must be a valid SCPI command for the given device |
required |
Returns:
| Type | Description |
|---|---|
str
|
The device response as a string |
read()
Read the device
Returns:
| Type | Description |
|---|---|
str
|
The string read from the instrument |
take_screenshot(filename)
Override this function to take a screenshot of the display of your particular device
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path of the file the screenshot will be saved at |
required |
write(SCPI)
Write a SCPI command to the device
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
SCPI
|
str
|
must be a valid SCPI command for the given device |
required |