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

MATES system wrapper class. More...

Public Member Functions

 Mates (string fileName, int addr=0)
 Create the MATES instance. More...
 
bool DiscoverSingleNode (int addr)
 Discover single MATES node using its CAN address. More...
 
bool DiscoverSingleNode (NodeId addr)
 Discover single MATES node using its CAN address. More...
 
Node NewNode (NodeId addr)
 Discover and create a new MATES-DIOX-MK1 node. More...
 
DioxNode NewDioxNode (NodeId addr)
 Discover and create a new MATES-DIOX-MK1 node. More...
 
Dio3Node NewDio3Node (NodeId addr)
 Discover and create a new MATES-DIO3-MK1 node. More...
 
UccNode NewUccNode (NodeId addr)
 Discover and create a new MATES-UCC-MK1 node. More...
 
Adc5Node NewAdc5Node (NodeId addr)
 Discover and create a new MATES-ADC5-MK1 node. More...
 
Dac5Node NewDac5Node (NodeId addr)
 Discover and create a new MATES-DAC5-MK1 node. More...
 
int GetRegisterI (int addr, RegisterNumber reg)
 Get regular (integral) MATES register. More...
 
float GetRegisterF (int addr, RegisterNumber reg)
 Get floating point MATES register. More...
 
GetRegister< T > (int addr, RegisterNumber reg)
 Get MATES register. More...
 
void SetRegister< T > (int addr, RegisterNumber reg, T value)
 Set MATES register. More...
 
void SetRegisterI (int addr, RegisterNumber reg, int val)
 Set regular (integral) MATES register. More...
 
void SetRegisterF (int addr, RegisterNumber reg, float val)
 Set floating point MATES register. More...
 
int GetAdcRaw (int addr, int channel)
 Get the raw value of the ADC. More...
 
List< NodeDiscoverNodes (int[] addr)
 Discover MATES nodes. More...
 
List< NodeDiscoverNodes (NodeId[] addr)
 Discover MATES nodes. More...
 
async Task< List< Node > > DiscoverNodesAsync (NodeId[] addr)
 Discover MATES nodes, asynchronous version. More...
 
string GetLastError ()
 Returns the description of lastly occurred error. More...
 
string GetError ()
 Get the accumulated error description. More...
 
int LampTest (int addr)
 Execute the lamp test. More...
 
string NodeInfo (int addr)
 Get node information as string. More...
 
void AlcdWrite (int addr, int row, int col, string text)
 Write text onto the alphanumeric LCD display. More...
 

Static Public Member Functions

static Mates FromBuffer (string confString, int addr=0)
 Create the MATES instance. More...
 
static T DllVersion< T > ()
 Get mates.dll file version. More...
 

Properties

DinStateChangeHandler OnDinStateChange
 Event raised when any digital input in the MATES system changes. More...
 
DoutStateChangeHandler OnDoutStateChange
 Event raised when any digital output in the MATES system changes. More...
 
AdcStateChangeHandler OnAdcStateChange
 Event raised when any analog input in the MATES system changes value. More...
 

Detailed Description

MATES system wrapper class.

Constructor & Destructor Documentation

Mates ( string  fileName,
int  addr = 0 
)

Create the MATES instance.

Parameters
fileNameDefines the name of the monitor configuration file(*.mon).
addrThe MATES device communication address to use

Member Function Documentation

static Mates FromBuffer ( string  confString,
int  addr = 0 
)
static

Create the MATES instance.

Parameters
confStringThe monitor XML configuration string.
addrThe MATES device communication address to use
static T DllVersion< T > ( )
static

Get mates.dll file version.

Template Parameters
TThe return value type, either string or Tuple<int, int, int, int>
Returns
The version.
Exceptions
MatesExceptionThrown when operation fails.
bool DiscoverSingleNode ( int  addr)

Discover single MATES node using its CAN address.

Parameters
addrThe device CAN address, see NodeId.
Returns
True when the device was found or false otherwise.
bool DiscoverSingleNode ( NodeId  addr)

Discover single MATES node using its CAN address.

Parameters
addrThe device CAN address.
Returns
True when the device was found or false otherwise.
Node NewNode ( NodeId  addr)

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

Parameters
addrThe node address to use.
Returns
The created node.
Exceptions
MatesExceptionThrown when the device cannot be found in the system.
DioxNode NewDioxNode ( NodeId  addr)

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

Parameters
addrThe node address to use.
Returns
The created node.
Exceptions
MatesExceptionThrown when the device cannot be found in the system.
Dio3Node NewDio3Node ( NodeId  addr)

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

Parameters
addrThe node address to use.
Returns
The created node.
Exceptions
MatesExceptionThrown when the device cannot be found in the system.
UccNode NewUccNode ( NodeId  addr)

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

Parameters
addrThe node address to use.
Returns
The created node.
Exceptions
MatesExceptionThrown when the device cannot be found in the system.
Adc5Node NewAdc5Node ( NodeId  addr)

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

Parameters
addrThe node address to use.
Returns
The created node.
Exceptions
MatesExceptionThrown when the device cannot be found in the system.
Dac5Node NewDac5Node ( NodeId  addr)

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

Parameters
addrThe node address to use.
Returns
The created node.
Exceptions
MatesExceptionThrown when the device cannot be found in the system.
int GetRegisterI ( int  addr,
RegisterNumber  reg 
)

Get regular (integral) MATES register.

Parameters
addrThe node CAN address.
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
Returns
The register value.
Exceptions
MatesExceptionThrown when operation fails.
float GetRegisterF ( int  addr,
RegisterNumber  reg 
)

Get floating point MATES register.

Parameters
addrThe node CAN address.
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
Returns
The register value.
Exceptions
MatesExceptionThrown when operation fails.
T GetRegister< T > ( int  addr,
RegisterNumber  reg 
)

Get MATES register.

Template Parameters
TThe register type, float or int.
Parameters
addrThe node CAN address.
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
Returns
The register value.
Exceptions
MatesExceptionThrown when operation fails.
Type Constraints
T :struct 
void SetRegister< T > ( int  addr,
RegisterNumber  reg,
value 
)

Set MATES register.

Template Parameters
TThe register type, float or int.
Parameters
addrThe node CAN address.
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
valueThe register value.
Exceptions
MatesExceptionThrown when operation fails.
Type Constraints
T :struct 
void SetRegisterI ( int  addr,
RegisterNumber  reg,
int  val 
)

Set regular (integral) MATES register.

Parameters
addrThe node CAN address.
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
valThe register value.
Exceptions
MatesExceptionThrown when operation fails.
void SetRegisterF ( int  addr,
RegisterNumber  reg,
float  val 
)

Set floating point MATES register.

Parameters
addrThe node CAN address.
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
valThe register value.
Exceptions
MatesExceptionThrown when operation fails.
int GetAdcRaw ( int  addr,
int  channel 
)

Get the raw value of the ADC.

Parameters
addrThe node address.
channelADC channel number [0, 39].
Returns
The raw ADC value.
Exceptions
MatesExceptionThrown when operation fails.
List<Node> DiscoverNodes ( int[]  addr)

Discover MATES nodes.

Parameters
addrList of nodes addresses to find.
Returns
Returns the list of nodes found or empty list on error.
List<Node> DiscoverNodes ( NodeId[]  addr)

Discover MATES nodes.

Parameters
addrList of nodes addresses to find.
Returns
Returns the list of nodes found or empty list on error.
async Task<List<Node> > DiscoverNodesAsync ( NodeId[]  addr)

Discover MATES nodes, asynchronous version.

Parameters
addrList of nodes addresses to find.
Returns
Returns the list of nodes found or empty list on error.
string GetLastError ( )

Returns the description of lastly occurred error.

Returns
The error description.
string GetError ( )

Get the accumulated error description.

Returns
The buffered errors or empty string.
int LampTest ( int  addr)

Execute the lamp test.

Parameters
addrThe node address.
Exceptions
MatesExceptionThrown when operation fails.
string NodeInfo ( int  addr)

Get node information as string.

Parameters
addrThe node address.
Returns
The node information in a textual form.
Exceptions
MatesExceptionThrown when operation fails.
void AlcdWrite ( int  addr,
int  row,
int  col,
string  text 
)

Write text onto the alphanumeric LCD display.

Parameters
addrThe node address.
rowThe LCD row number (0 - based).
colThe LCD column number (0 - based).
textThe text to write at the given position.
Exceptions
MatesExceptionThrown when operation fails.

Property Documentation

DinStateChangeHandler OnDinStateChange
addremove

Event raised when any digital input in the MATES system changes.

The state change sampling period is roughly 50 ms and it increases with the number of nodes in the system.

The first subscriber will receive states of all inputs even if they are not changing (this action is performed only once after subscribing). This is done for the subscriber to be able to determine the initial state after device connection. The same procedure is repeated every time the subscribers list becomes empty and then re-populated.

DoutStateChangeHandler OnDoutStateChange
addremove

Event raised when any digital output in the MATES system changes.

The state change sampling period is roughly 50 ms and it increases with the number of nodes in the system.

The first subscriber will receive states of all outputs even if they are not changing (this action is performed only once after subscribing). This is done for the subscriber to be able to determine the initial state after device connection. The same procedure is repeated every time the subscribers list becomes empty and then re-populated.

AdcStateChangeHandler OnAdcStateChange
addremove

Event raised when any analog input in the MATES system changes value.

The value change sampling period is roughly 50 ms and it increases with the number of nodes in the system.

The first subscriber will receive values of all inputs even if they are not changing (this action is performed only once after subscribing). This is done for the subscriber to be able to determine the initial state after device connection. The same procedure is repeated every time the subscribers list becomes empty and then re-populated.


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