MATES / Modular Automatic Test Equipment System API  2.5.0.0
Public Member Functions
Mates Class Reference

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

Detailed Description

The MATES-DLL Python wrapper class.

Constructor & Destructor Documentation

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.

Parameters
[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.
1 import mates
2 
3 # Standard way of using:
4 m = mates.mates()
5 m.start("default.mon")
6 m.stop()
7 
8 # Alternatively the with construct can be used:
9 with mates.mates("default.mon") as m:
10  print(m.get_err())

Member Function Documentation

def get_err (   self)

Get the accumulated error description.

Returns
(str) The buffered errors or empty string.
def clear_errors (   self)

Clear the accumulated error messages.

Example (mates_test_05.py):

1 import time
2 import mates
3 
4 with mates.Mates("proxy.mon", 1) as m:
5  # Wait for the device to be connected.
6  for i in range(10):
7  try:
8  if m.discover_single_node(mates.Mates_dio3_mk1_1) == True:
9  print("Found")
10  break
11  except:
12  # Clear the errors and continue.
13  m.clear_errors()
14  time.sleep(0.1)
def start (   self,
  filename,
  channel 
)

Open the MATES communication channel.

Parameters
[in]filename(str) - file name of the configuration file.
[in]channel(int) The associated channel number (as defined in configuration file).
Returns
(bool) - True when successful, otherwise False.

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.

Parameters
[in]filename(str) - file name of the configuration file.
[in]channel(int) The associated channel number (as defined in configuration file).
Returns
(Mates) The current instance.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_01.py):

1 import mates
2 m = mates.Mates()
3 
4 with m.open("proxy.mon", 1) as x:
5  x.print_err()
def open_buffer (   self,
  conf_string,
  channel 
)

Open the MATES communication channel.

Parameters
[in]conf_string(str) uOS_monitor XML configuration string.
[in]channel(int) The associated channel number.
Returns
(Mates) The current instance.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_33.py):

1 import mates
2 
3 cfg = r"""<?xml version="1.0" encoding="utf-8"?>
4 <uOS_monitor_configuration>
5  <local_address>1</local_address>
6  <named_pipe map="1">
7  <name>\\RAKIETA\pipe\MATES_PROXY_PIPE</name>
8  <timeout>5000</timeout>
9  </named_pipe>
10 </uOS_monitor_configuration>"""
11 
12 m = mates.Mates()
13 m.open_buffer(cfg, 1)
14 print("Node 30 present: ", m.discover_node(30))
15 
16 m.close()
def close (   self)

Close the MATES communication interface.

Example (mates_test_02.py):

1 import mates
2 m = mates.Mates("proxy.mon", 1)
3 m.close()
def dll_version (   self)

Get MATES DLL version.

Returns
(int, int, int, int) The mates.dll file major version, minor version, revision and build number.

Example (mates_test_03.py):

1 import mates
2 m = mates.Mates()
3 version = m.monitor_version()
4 print("uOS_monitor version: {0}".format(".".join(map(str, version))))
def dll_path (   self)

Get MATES DLL path.

Returns
str - the mates.dll file path.
Since
mates.dll 2.3.0.0

Example (mates_test_29.py):

1 import mates
2 m = mates.Mates()
3 version = m.dll_version()
4 print("MATES dll version: {0}".format(".".join(map(str, version))))
def monitor_version (   self)

Get the underlying uOS_monitor instance version.

Returns
(int, int, int, int) The uOS_monitor interface file major version, minor version, revision and build number.
Since
mates.dll 2.0.1.0

Example (mates_test_30.py):

1 import mates
2 m = mates.Mates()
3 path = m.dll_path()
4 print("MATES dll path: {0}".format(path))
def monitor_path (   self)

Get the underlying uOS_monitor instance path.

Returns
(str) The uOS_monitor interface path.
Since
mates.dll 2.3.0.0

Example (mates_test_03.py):

1 import mates
2 m = mates.Mates()
3 version = m.monitor_version()
4 print("uOS_monitor version: {0}".format(".".join(map(str, version))))
def version_str (   self)

Get MATES software version.

Returns
(str) The version string.
def set_dout (   self,
  addr,
  channel,
  value 
)

Set value of an individual digital output.

Parameters
[in]addr(int) The CAN node address.
[in]channel(int) The DOUT channel number [0,19].
[in]value(int) The output value.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_04.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  m.set_dout(m.mates_dio3_mk1_1, 5, 1)
5  m.set_dout(m.mates_dio3_mk1_1, 5, 0)
6  elif m.discover_node(m.mates_diox_mk1_1):
7  m.set_dout(m.mates_diox_mk1_1, 5, 1)
8  m.set_dout(m.mates_diox_mk1_1, 5, 0)
def set_dout_all (   self,
  addr,
  value,
  mode = DIO_OUT_MODE_SET 
)

Set value of all outputs.

Parameters
[in]addr(int) The CAN node address.
[in]value(int) The value to set.
[in]mode(int) The setting mode (see MATES manual):
  • 0: SET (OUT <- value)
  • 1: AND (OUT <- OUT & value)
  • 2: OR (OUT <- OUT | value)
  • 3: XOR (OUT <- OUT ^ value)
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_19.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  m.set_dout_all(m.mates_dio3_mk1_1, 0xAAAAA)
5  m.set_dout_all(m.mates_dio3_mk1_1, 0xFFFFF, mates.Mates.DIO_OUT_MODE_XOR)
6  print("Outputs (expecting 0x55555): 0x{0:X}".format(m.get_din_all(m.mates_dio3_mk1_1)))
def get_dout (   self,
  addr,
  channel 
)

Get value of an individual digital output.

Parameters
[in]addr(int) The CAN node address.
[in]channel(int) The DOUT channel number [0,19].
Returns
(int) The state of the output.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_06.py):

1 import random
2 import mates
3 with mates.Mates("proxy.mon", 1) as m:
4  if m.discover_node(m.mates_dio3_mk1_1):
5  m.set_dout(m.mates_dio3_mk1_1, 1, random.randint(0, 1))
6  print("Value set: {0}".format(m.get_dout(m.mates_dio3_mk1_1, 1)))
def get_dout_all (   self,
  addr 
)

Get value of all digital outputs.

Parameters
[in]addr(int) The CAN node address.
Returns
(int) The state of all outputs, LSB is OUT01.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_21.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  # Set the outputs to some value.
5  m.set_dout_all(m.mates_dio3_mk1_1, 0xBAFED)
6  # Now read back.
7  print("Outputs: 0x{0:X}".format(m.get_dout_all(m.mates_dio3_mk1_1)))
def get_din (   self,
  addr,
  channel 
)

Get the value of an individual digital input.

Parameters
[in]addr(int) The CAN node address.
[in]channel(int) The DOUT channel number [0,19].
Returns
(int) The state of the input.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_07.py):

1 import time
2 import mates
3 with mates.Mates("proxy.mon", 1) as m:
4  if m.discover_node(m.mates_dio3_mk1_1):
5  # Wait for IN05 to become high.
6  for i in range(5):
7  if m.get_din(m.mates_dio3_mk1_1, 4) == 1:
8  print("IN05 became high")
9  break
10  time.sleep(0.1)
def get_din_all (   self,
  addr 
)

Get the value of all digital inputs.

Parameters
[in]addr(int) The CAN node address.
Returns
(int) The state of the inputs, LSB is IN01.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_20.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  # Set the least significant nibble of the outputs to high state.
5  m.set_dout_all(m.mates_dio3_mk1_1, 0xF, mates.Mates.DIO_OUT_MODE_OR)
6  # See what the result is (assuming we have loopback installed).
7  print("Inputs: 0x{0:X}".format(m.get_din_all(m.mates_dio3_mk1_1)))
def toggle_dout (   self,
  addr,
  channel 
)

Toggle value of an individual digital output.

Parameters
[in]addr(int) The CAN node address.
[in]channel(int) The DOUT channel number [0,19].
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_08.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(20):
4  for i in range(100):
5  # Toggle 20th channel of first DIO3 node.
6  m.toggle_dout(20, 19)
def set_dac_raw (   self,
  addr,
  channel,
  value 
)

Set raw value of the DAC.

Parameters
[in]addr(int) The node address.
[in]channel(int) - DAC channel number [0,39].
[in]value(int) The raw DAC binary code to write.
Note
This function ignores the DAC calibration data.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_09.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dac5_mk1_2):
4  # Set to ~0.5 V.
5  value = int((0.5 / 5.0) * 0x10000)
6  print("Setting raw DAC value: {0}".format(value))
7  m.set_dac_raw(m.mates_dac5_mk1_2, 39, value & 0xFFFF)
8 
9  # When setting out of range exception is raised.
10  try:
11  m.set_dac_raw(m.mates_dac5_mk1_2, 39, 0xFFFF + 1)
12  except mates.MatesException as e:
13  print("Error setting DAC:")
14  print(e)
def get_dac_raw (   self,
  addr,
  channel 
)

Get the raw value of the DAC.

Parameters
[in]addr(int) The node address.
[in]channel(int) The DAC channel number [0,39].
Returns
(int) The raw DAC value.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_10.py):

1 import random
2 import mates
3 with mates.Mates("proxy.mon", 1) as m:
4  if m.discover_node(m.mates_dac5_mk1_2):
5  # Set to random.
6  value = random.randint(0, 100)
7  m.set_dac_raw(m.mates_dac5_mk1_2, 39, value)
8  print("Raw DAC value: {0}".format(m.get_dac_raw(m.mates_dac5_mk1_2, 39)))
def set_dac (   self,
  addr,
  channel,
  value 
)

Set the value of the DAC.

Takes calibration data into account.

Parameters
[in]addr(int) The node address.
[in]channel(int) The DAC channel number [0,39].
[in]value(float) The voltage value to set (Volts).
Note
This function takes calibration data into account.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_11.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dac5_mk1_2):
4  # Set DAC voltage to 1 V if digital input is 0 or
5  # to 2 V if the digital input is 1.
6  if not m.get_din(m.mates_dio3_mk1_1, 0):
7  m.set_dac(m.mates_dac5_mk1_2, 0, 1.0)
8  else:
9  m.set_dac(m.mates_dac5_mk1_2, 0, 2.0)
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.

Parameters
[in]addr(int) The node address.
[in]channel(int) DAC channel number [0,39].
Returns
(float) - DAC voltage value in Volts.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_12.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dac5_mk1_2):
4  # Compare the value written and read.
5  value = 2.0 / 3.0
6  m.set_dac(m.mates_dac5_mk1_2, 10, value)
7  check = m.get_dac(m.mates_dac5_mk1_2, 10)
8  print("{0} vs {1}".format(value, check))
def get_adc (   self,
  addr,
  channel 
)

Get the value of the ADC (Volts).

Parameters
[in]addr(int) The node address.
[in]channel(int) ADC channel number [0,39].
Returns
(float) - ADC voltage value in Volts.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_23.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_adc5_mk1_1):
4  # Get voltage read from channel IN10.
5  value = m.get_adc(m.mates_adc5_mk1_1, 9)
6  print("Voltage at channel IN10: {0} V".format(value))
def get_adc_raw (   self,
  addr,
  channel 
)

Get the raw value of the ADC.

Parameters
[in]addr(int) The node address.
[in]channel(int) - ADC channel number [0,39].
Returns
(int) The raw ADC value.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_24.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_adc5_mk1_1):
4  # Get raw ADC code read from channel IN10.
5  value = m.get_adc_raw(m.mates_adc5_mk1_1, 9)
6  print("Raw value at channel IN10: {0}".format(value))
def save_default (   self,
  addr,
  channel 
)

Save the current value of an output channel as a default value.

Parameters
[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.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_25.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  # Set channel OUT20 to high, save as default,
5  # then set to low and save as default.
6  m.set_dout(m.mates_dio3_mk1_1, 19, 1)
7  m.save_default(m.mates_dio3_mk1_1, 19)
8  m.set_dout(m.mates_dio3_mk1_1, 19, 0)
9  m.save_default(m.mates_dio3_mk1_1, 19)
def set_reg (   self,
  addr,
  reg,
  val 
)

Set regular (integral) MATES register.

Parameters
[in]addr(int) The node address.
[in]reg(int) The register number to access (see regs.MATES_REGS).
[out]val(int) The register value.
Exceptions
MatesExceptionThrown when operation fails.
MatesRangeErrorThrown when written value was out of range.

Example (mates_test_13.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  # Set ODEF bit in CR register to set all outputs to their default values.
5  m.set_reg(m.mates_dio3_mk1_1, m.regs.REG_COMMON_CR, 1)
def set_regf (   self,
  addr,
  reg,
  val 
)

Set floating point MATES register.

Parameters
[in]addr(int) The node address.
[in]reg(int) The register number to access (see regs.MATES_REGS).
[in]val(float) The register value.
Exceptions
MatesExceptionThrown when operation fails.
MatesRangeErrorThrown when written value was out of range.

Example (mates_test_17.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dac5_mk1_2):
4  # Set default values of all DAC channels to 0.1 V.
5  for channel in range(40):
6  m.set_regf(m.mates_dac5_mk1_2, m.regs.REG_MATES_DAC5_MK1_DEF01 + channel, 0.1)
def get_reg (   self,
  addr,
  reg 
)

Get regular (integral) MATES register.

Parameters
[in]addr(int) The node address.
[in]reg(int) The register number to access (see regs.MATES_REGS).
Returns
(int) the register value.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_15.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  # Get hardware revision for the device from the DIR register.
5  dir = m.get_reg(m.mates_dio3_mk1_1, m.regs.REG_COMMON_DIR)
6  version = (dir >> 24) & 0xFF
7  print("Hardware version: MK{0}".format(version))
def get_regf (   self,
  addr,
  reg 
)

Get floating point MATES register.

Parameters
[in]addr(int) The node address.
[in]reg(int) The register number to access (see regs.MATES_REGS).
Returns
(float) The register value.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_16.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dac5_mk1_2):
4  # Get default value of the first DAC output.
5  value = m.get_regf(m.mates_dac5_mk1_2, m.regs.REG_MATES_DAC5_MK1_DEF01)
6  print("Default voltage value: {0} V".format(value))
def discover_node (   self,
  addr 
)

Check if the specified node is present on the bus.

Parameters
[in]addr(int) The CAN node address.
Returns
(bool) True when device present, otherwise False.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_32.py):

1 import mates
2 
3 with mates.Mates("proxy.mon", 1) as m:
4  for node in (20, 21, 40, 41):
5  if m.discover_node(node):
6  print("Discovered node #{0}".format(node))
7  else:
8  print("Node #{0} not found".format(node))
9 
def node_info (   self,
  addr 
)

Get node information in form of a string.

Parameters
[in]addr(int) The CAN node address.
Returns
(str) The node information string.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_22.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  print("Connected nodes:")
4  for node in (20, 21, 50, 51):
5  try:
6  print(m.node_info(node))
7  except:
8  print("<not found>")
def enable_generators (   self,
  addr,
  enable 
)

Enable signal generators for a node.

Parameters
[in]addr(int) The CAN node address.
[in]enable(int) The generators enable state.
Remarks
Only MATES-DIO3-MK1 support signal generators.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_26.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  # Disable the generators and then enable them,
5  # this resets all time bases of the generators.
6  m.enable_generators(m.mates_dio3_mk1_1, False)
7  m.enable_generators(m.mates_dio3_mk1_1, True)
8 
def setup_generator (   self,
  addr,
  channel,
  period,
  rise_time,
  fall_time 
)

Setup signal generator for a digital channel.

Parameters
[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.
Note
period, rise_time and fall_time have to be a multiple of 125 us.
Remarks
Only MATES-DIO3-MK1 nodes support signal generators.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_27.py):

1 import time
2 import mates
3 with mates.Mates("proxy.mon", 1) as m:
4  if m.discover_node(m.mates_dio3_mk1_1):
5  # Generate quadrature waveform on OUT01 and OUT02 at 100 Hz.
6  m.enable_generators(m.mates_dio3_mk1_1, False)
7  m.setup_generator(m.mates_dio3_mk1_1, 0, 10000, 0, 5000)
8  m.setup_generator(m.mates_dio3_mk1_1, 1, 10000, 2500, 7500)
9  m.enable_generators(m.mates_dio3_mk1_1, True)
10  # Generate for 2 seconds.
11  time.sleep(2)
12  # Disable the generators and clear the outputs.
13  m.setup_generator(m.mates_dio3_mk1_1, 0, 0, 0, 0)
14  m.setup_generator(m.mates_dio3_mk1_1, 1, 0, 0, 0)
15  m.enable_generators(m.mates_dio3_mk1_1, False)
16  m.set_dout_all(m.mates_dio3_mk1_1, 0)
def lamp_test (   self,
  addr 
)

Execute the lamp test.

See CR register documentation for details.

Parameters
[in]addr(int) The CAN node address.
Note
This function blocks until entire lamp test sequence is executed. For MK1 nodes this lasts ca 5 seconds.
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_28.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_dio3_mk1_1):
4  # Locate node by blinking its LEDs.
5  m.lamp_test(m.mates_dio3_mk1_1)
def alcd_write (   self,
  addr,
  row,
  col,
  text 
)

Write text onto the alphanumeric LCD display.

Parameters
[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.
Remarks
This functionality is available only on MATES-UCC-MK1 devices.
Since
mates.dll 2.4.0.0
Exceptions
MatesExceptionThrown when operation fails.

Example (mates_test_31.py):

1 import mates
2 with mates.Mates("proxy.mon", 1) as m:
3  if m.discover_node(m.mates_ucc_mk1_1):
4  text = "Padded with spaces".ljust(32)
5  m.alcd_write(m.mates_ucc_mk1_1, 0, 0, text)
def new_ucc_node (   self,
  addr 
)

Discover and create a new MATES-UCC-MK1 node.

Parameters
[in]addr(int) The node address to use.
Returns
(UccNode) The created node.
Exceptions
MatesExceptionThrown when the device cannot be found in the system.

The documentation for this class was generated from the following file: