/ MATES / Modular Automatic Test Equipment System API
2.5.0.0
|
The MATES-DLL Python wrapper class. More...
Public Member Functions | |
def | __init__ (self, filename=None, channel=None) |
Create the MATES instance. More... | |
def | __str__ (self) |
The string representation of the MATES object. | |
def | print_err (self) |
Print the accumulated error messages to the standard output. | |
def | get_err (self) |
Get the accumulated error description. More... | |
def | clear_errors (self) |
Clear the accumulated error messages. More... | |
def | start (self, filename, channel) |
Open the MATES communication channel. More... | |
def | stop (self) |
Finalize the MATES object. | |
def | open (self, filename, channel) |
Open the MATES communication channel. More... | |
def | open_buffer (self, conf_string, channel) |
Open the MATES communication channel. More... | |
def | close (self) |
Close the MATES communication interface. More... | |
def | dll_version (self) |
Get MATES DLL version. More... | |
def | dll_path (self) |
Get MATES DLL path. More... | |
def | monitor_version (self) |
Get the underlying uOS_monitor instance version. More... | |
def | monitor_path (self) |
Get the underlying uOS_monitor instance path. More... | |
def | version_str (self) |
Get MATES software version. More... | |
def | set_dout (self, addr, channel, value) |
Set value of an individual digital output. More... | |
def | set_dout_all (self, addr, value, mode=DIO_OUT_MODE_SET) |
Set value of all outputs. More... | |
def | get_dout (self, addr, channel) |
Get value of an individual digital output. More... | |
def | get_dout_all (self, addr) |
Get value of all digital outputs. More... | |
def | get_din (self, addr, channel) |
Get the value of an individual digital input. More... | |
def | get_din_all (self, addr) |
Get the value of all digital inputs. More... | |
def | toggle_dout (self, addr, channel) |
Toggle value of an individual digital output. More... | |
def | set_dac_raw (self, addr, channel, value) |
Set raw value of the DAC. More... | |
def | get_dac_raw (self, addr, channel) |
Get the raw value of the DAC. More... | |
def | set_dac (self, addr, channel, value) |
Set the value of the DAC. More... | |
def | get_dac (self, addr, channel) |
Get the value of the DAC. More... | |
def | get_adc (self, addr, channel) |
Get the value of the ADC (Volts). More... | |
def | get_adc_raw (self, addr, channel) |
Get the raw value of the ADC. More... | |
def | save_default (self, addr, channel) |
Save the current value of an output channel as a default value. More... | |
def | set_reg (self, addr, reg, val) |
Set regular (integral) MATES register. More... | |
def | set_regf (self, addr, reg, val) |
Set floating point MATES register. More... | |
def | get_reg (self, addr, reg) |
Get regular (integral) MATES register. More... | |
def | get_regf (self, addr, reg) |
Get floating point MATES register. More... | |
def | discover_node (self, addr) |
Check if the specified node is present on the bus. More... | |
def | node_info (self, addr) |
Get node information in form of a string. More... | |
def | enable_generators (self, addr, enable) |
Enable signal generators for a node. More... | |
def | setup_generator (self, addr, channel, period, rise_time, fall_time) |
Setup signal generator for a digital channel. More... | |
def | lamp_test (self, addr) |
Execute the lamp test. More... | |
def | alcd_write (self, addr, row, col, text) |
Write text onto the alphanumeric LCD display. More... | |
def | new_ucc_node (self, addr) |
Discover and create a new MATES-UCC-MK1 node. More... | |
The MATES-DLL Python wrapper class.
def __init__ | ( | self, | |
filename = None , |
|||
channel = None |
|||
) |
Create the MATES instance.
If at least filename is specified the MATES communication channel will be opened immediately.
[in] | filename | (str) - if specified defines the name of the monitor configuration file (*.mon). |
[in] | channel | (int) The communication channel number, use 0 for direct connections. Cannot be specified without specifying filename. |
def get_err | ( | self | ) |
Get the accumulated error description.
def clear_errors | ( | self | ) |
def start | ( | self, | |
filename, | |||
channel | |||
) |
Open the MATES communication channel.
[in] | filename | (str) - file name of the configuration file. |
[in] | channel | (int) The associated channel number (as defined in configuration file). |
This function can be omitted if MATES instance is created with at least file name (see constructor).
def open | ( | self, | |
filename, | |||
channel | |||
) |
Open the MATES communication channel.
[in] | filename | (str) - file name of the configuration file. |
[in] | channel | (int) The associated channel number (as defined in configuration file). |
MatesException | Thrown when operation fails. |
Example (mates_test_01.py):
def open_buffer | ( | self, | |
conf_string, | |||
channel | |||
) |
Open the MATES communication channel.
[in] | conf_string | (str) uOS_monitor XML configuration string. |
[in] | channel | (int) The associated channel number. |
MatesException | Thrown when operation fails. |
Example (mates_test_33.py):
def close | ( | self | ) |
Close the MATES communication interface.
Example (mates_test_02.py):
def dll_version | ( | self | ) |
Get MATES DLL version.
Example (mates_test_03.py):
def dll_path | ( | self | ) |
Get MATES DLL path.
Example (mates_test_29.py):
def monitor_version | ( | self | ) |
Get the underlying uOS_monitor instance version.
Example (mates_test_30.py):
def monitor_path | ( | self | ) |
Get the underlying uOS_monitor instance path.
Example (mates_test_03.py):
def version_str | ( | self | ) |
Get MATES software version.
def set_dout | ( | self, | |
addr, | |||
channel, | |||
value | |||
) |
Set value of an individual digital output.
[in] | addr | (int) The CAN node address. |
[in] | channel | (int) The DOUT channel number [0,19]. |
[in] | value | (int) The output value. |
MatesException | Thrown when operation fails. |
Example (mates_test_04.py):
def set_dout_all | ( | self, | |
addr, | |||
value, | |||
mode = DIO_OUT_MODE_SET |
|||
) |
Set value of all outputs.
[in] | addr | (int) The CAN node address. |
[in] | value | (int) The value to set. |
[in] | mode | (int) The setting mode (see MATES manual):
|
MatesException | Thrown when operation fails. |
Example (mates_test_19.py):
def get_dout | ( | self, | |
addr, | |||
channel | |||
) |
Get value of an individual digital output.
[in] | addr | (int) The CAN node address. |
[in] | channel | (int) The DOUT channel number [0,19]. |
MatesException | Thrown when operation fails. |
Example (mates_test_06.py):
def get_dout_all | ( | self, | |
addr | |||
) |
Get value of all digital outputs.
[in] | addr | (int) The CAN node address. |
MatesException | Thrown when operation fails. |
Example (mates_test_21.py):
def get_din | ( | self, | |
addr, | |||
channel | |||
) |
Get the value of an individual digital input.
[in] | addr | (int) The CAN node address. |
[in] | channel | (int) The DOUT channel number [0,19]. |
MatesException | Thrown when operation fails. |
Example (mates_test_07.py):
def get_din_all | ( | self, | |
addr | |||
) |
Get the value of all digital inputs.
[in] | addr | (int) The CAN node address. |
MatesException | Thrown when operation fails. |
Example (mates_test_20.py):
def toggle_dout | ( | self, | |
addr, | |||
channel | |||
) |
Toggle value of an individual digital output.
[in] | addr | (int) The CAN node address. |
[in] | channel | (int) The DOUT channel number [0,19]. |
MatesException | Thrown when operation fails. |
Example (mates_test_08.py):
def set_dac_raw | ( | self, | |
addr, | |||
channel, | |||
value | |||
) |
Set raw value of the DAC.
[in] | addr | (int) The node address. |
[in] | channel | (int) - DAC channel number [0,39]. |
[in] | value | (int) The raw DAC binary code to write. |
MatesException | Thrown when operation fails. |
Example (mates_test_09.py):
def get_dac_raw | ( | self, | |
addr, | |||
channel | |||
) |
Get the raw value of the DAC.
[in] | addr | (int) The node address. |
[in] | channel | (int) The DAC channel number [0,39]. |
MatesException | Thrown when operation fails. |
Example (mates_test_10.py):
def set_dac | ( | self, | |
addr, | |||
channel, | |||
value | |||
) |
Set the value of the DAC.
Takes calibration data into account.
[in] | addr | (int) The node address. |
[in] | channel | (int) The DAC channel number [0,39]. |
[in] | value | (float) The voltage value to set (Volts). |
MatesException | Thrown when operation fails. |
Example (mates_test_11.py):
def get_dac | ( | self, | |
addr, | |||
channel | |||
) |
Get the value of the DAC.
When using mates_set_dac() and mates_get_dac() in a pair, the verified value may be slightly different than the set value. This is due to the fact that the value is internally converted to single precision floating point value so precision of the double precision argument can be lost. This behaviour may change in the future.
[in] | addr | (int) The node address. |
[in] | channel | (int) DAC channel number [0,39]. |
MatesException | Thrown when operation fails. |
Example (mates_test_12.py):
def get_adc | ( | self, | |
addr, | |||
channel | |||
) |
Get the value of the ADC (Volts).
[in] | addr | (int) The node address. |
[in] | channel | (int) ADC channel number [0,39]. |
MatesException | Thrown when operation fails. |
Example (mates_test_23.py):
def get_adc_raw | ( | self, | |
addr, | |||
channel | |||
) |
Get the raw value of the ADC.
[in] | addr | (int) The node address. |
[in] | channel | (int) - ADC channel number [0,39]. |
MatesException | Thrown when operation fails. |
Example (mates_test_24.py):
def save_default | ( | self, | |
addr, | |||
channel | |||
) |
Save the current value of an output channel as a default value.
[in] | addr | (int) The node address. |
[in] | channel | (int) - output node channel number, [0,39] for DAC node, [0,19] for DIO3 or DIOX node. |
MatesException | Thrown when operation fails. |
Example (mates_test_25.py):
def set_reg | ( | self, | |
addr, | |||
reg, | |||
val | |||
) |
Set regular (integral) MATES register.
[in] | addr | (int) The node address. |
[in] | reg | (int) The register number to access (see regs.MATES_REGS). |
[out] | val | (int) The register value. |
MatesException | Thrown when operation fails. |
MatesRangeError | Thrown when written value was out of range. |
Example (mates_test_13.py):
def set_regf | ( | self, | |
addr, | |||
reg, | |||
val | |||
) |
Set floating point MATES register.
[in] | addr | (int) The node address. |
[in] | reg | (int) The register number to access (see regs.MATES_REGS). |
[in] | val | (float) The register value. |
MatesException | Thrown when operation fails. |
MatesRangeError | Thrown when written value was out of range. |
Example (mates_test_17.py):
def get_reg | ( | self, | |
addr, | |||
reg | |||
) |
Get regular (integral) MATES register.
[in] | addr | (int) The node address. |
[in] | reg | (int) The register number to access (see regs.MATES_REGS). |
MatesException | Thrown when operation fails. |
Example (mates_test_15.py):
def get_regf | ( | self, | |
addr, | |||
reg | |||
) |
Get floating point MATES register.
[in] | addr | (int) The node address. |
[in] | reg | (int) The register number to access (see regs.MATES_REGS). |
MatesException | Thrown when operation fails. |
Example (mates_test_16.py):
def discover_node | ( | self, | |
addr | |||
) |
Check if the specified node is present on the bus.
[in] | addr | (int) The CAN node address. |
MatesException | Thrown when operation fails. |
Example (mates_test_32.py):
def node_info | ( | self, | |
addr | |||
) |
Get node information in form of a string.
[in] | addr | (int) The CAN node address. |
MatesException | Thrown when operation fails. |
Example (mates_test_22.py):
def enable_generators | ( | self, | |
addr, | |||
enable | |||
) |
Enable signal generators for a node.
[in] | addr | (int) The CAN node address. |
[in] | enable | (int) The generators enable state. |
MatesException | Thrown when operation fails. |
Example (mates_test_26.py):
def setup_generator | ( | self, | |
addr, | |||
channel, | |||
period, | |||
rise_time, | |||
fall_time | |||
) |
Setup signal generator for a digital channel.
[in] | addr | (int) The CAN node address. |
[in] | channel | (int) The generator channel to setup [0,19]. |
[in] | period | (int) The waveform period in microseconds. |
[in] | rise_time | (int) - signal rise time within the period in microseconds. |
[in] | fall_time | (int) - signal fall time within the period in microseconds. |
MatesException | Thrown when operation fails. |
Example (mates_test_27.py):
def lamp_test | ( | self, | |
addr | |||
) |
Execute the lamp test.
See CR register documentation for details.
[in] | addr | (int) The CAN node address. |
MatesException | Thrown when operation fails. |
Example (mates_test_28.py):
def alcd_write | ( | self, | |
addr, | |||
row, | |||
col, | |||
text | |||
) |
Write text onto the alphanumeric LCD display.
[in] | addr | (int) The node CAN address. |
[in] | row | (int) The LCD row number (0 - based). |
[in] | col | (int) The LCD column number (0 - based). |
[in] | text | (str) Text to write at the given position. |
MatesException | Thrown when operation fails. |
Example (mates_test_31.py):
def new_ucc_node | ( | self, | |
addr | |||
) |
Discover and create a new MATES-UCC-MK1 node.
[in] | addr | (int) The node address to use. |
MatesException | Thrown when the device cannot be found in the system. |