MATES / Modular Automatic Test Equipment System API  2.5.0.0
Public Member Functions | Properties
IAdcNode Interface Reference

Represents a common ADC module. More...

Public Member Functions

double GetAdc (int channel)
 Get the value of the ADC. More...
 
int GetAdcRaw (int channel)
 Get the raw value of the ADC. More...
 
int GetNumChannels ()
 Get number of channels of the ADC. More...
 
PhysicalValue GetRangeMax (int channel)
 Get the maximum value of a channel. More...
 
float GetRegisterF (RegisterNumber reg)
 Get floating point MATES register. More...
 
int GetRegisterI (RegisterNumber reg)
 Get regular (integral) MATES register. More...
 
void SetRegisterI (RegisterNumber reg, int val)
 Set regular (integral) MATES register. More...
 
void SetRegisterF (RegisterNumber reg, float val)
 Set floating point MATES register. More...
 

Properties

Mates Owner [get]
 The MATES system that this node belongs to. More...
 
NodeId NodeId [get]
 The MATES system that this node belongs to. More...
 
int Addr [get]
 The node address. More...
 

Detailed Description

Represents a common ADC module.

Member Function Documentation

double GetAdc ( int  channel)

Get the value of the ADC.

Parameters
channelThe ADC channel number [0,39].
Returns
ADC voltage value in Volts.

Example usage (mates_test_01.cs):

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Viresco.Mates;
namespace unit_tests
{
[TestClass]
public class mates_test_01
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Adc5Node node = mates.NewAdc5Node(NodeId.mates_adc5_mk1_1);
Console.Write("Voltage at channel IN01: {0} V\n", node.GetAdc(0));
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}

Implemented in AdcNode, and UccNode.

int GetAdcRaw ( int  channel)

Get the raw value of the ADC.

Parameters
channelThe ADC channel number [0,39]
Returns
The raw ADC value.

Example usage (mates_test_02.cs):

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Viresco.Mates;
namespace unit_tests
{
[TestClass]
public class mates_test_02
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Adc5Node node = mates.NewAdc5Node(NodeId.mates_adc5_mk1_1);
int val = node.GetAdcRaw(0);
Console.Write("Raw value at channel IN01: {0} V\n", val);
Assert.IsTrue(val >= 0 && val <= 65535);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}

Implemented in AdcNode, and UccNode.

int GetNumChannels ( )

Get number of channels of the ADC.

Returns
The number of channels.

Implemented in Adc5Node, AdcNode, and UccNode.

PhysicalValue GetRangeMax ( int  channel)

Get the maximum value of a channel.

Parameters
channel
Returns
The maximum value in Volts, Amperes or Degrees Centigrade.

Implemented in Adc5Node, AdcNode, and UccNode.

float GetRegisterF ( RegisterNumber  reg)
inherited

Get floating point MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
Returns
The register value.
int GetRegisterI ( RegisterNumber  reg)
inherited

Get regular (integral) MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
Returns
The register value.
void SetRegisterI ( RegisterNumber  reg,
int  val 
)
inherited

Set regular (integral) MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
valThe register value.
void SetRegisterF ( RegisterNumber  reg,
float  val 
)
inherited

Set floating point MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
valThe register value.

Property Documentation

Mates Owner
getinherited

The MATES system that this node belongs to.

NodeId NodeId
getinherited

The MATES system that this node belongs to.

int Addr
getinherited

The node address.


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