Represents single MATES-ADC5-MK1 node.
More...
|
RegList | Registers |
| The registers that are associated with this node. Populated by the node constructor. More...
|
|
Represents single MATES-ADC5-MK1 node.
The Adc5Node constructor is not intended to be called directly. Use Mates.NewDioxNode instead.
override int GetNumChannels |
( |
| ) |
|
|
virtual |
Get number of channels of the ADC.
- Returns
- The number of channels.
Implements AdcNode.
override PhysicalValue GetRangeMax |
( |
int |
channel | ) |
|
|
virtual |
Get the maximum value of a channel.
- Parameters
-
- Returns
- The maximum value in Volts, Amperes or Degrees Centigrade.
Implements AdcNode.
double GetAdc |
( |
int |
channel | ) |
|
|
inherited |
Get the value of the ADC.
- Parameters
-
channel | The ADC channel number [0,39]. |
- Returns
- ADC voltage value in Volts.
Example usage (mates_test_01.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
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");
}
}
}
}
}
Implements IAdcNode.
int GetAdcRaw |
( |
int |
channel | ) |
|
|
inherited |
Get the raw value of the ADC.
- Parameters
-
channel | The ADC channel number [0,39] |
- Returns
- The raw ADC value.
Example usage (mates_test_02.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
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");
}
}
}
}
}
Implements IAdcNode.
Check if this node acts as a CAN bridge (it is connected directly to PC).
- Returns
- True if CAN bridge, otherwise false.
int GetStatusRegister |
( |
| ) |
|
|
inherited |
Get the value of the status register.
- Returns
- The REG_COMMON_SR register value.
Get regular (integral) MATES register.
- Parameters
-
- Returns
- The register value.
Get floating point MATES register.
- Parameters
-
- Returns
- The register value.
Set regular (integral) MATES register.
- Parameters
-
Set floating point MATES register.
- Parameters
-
Asserts that the specified integral register has the specified value.
- Parameters
-
register | The register number. |
value | The expected value. |
Implements INodeAsserts.
Asserts that the specified floating point register has the specified value.
- Parameters
-
register | The register number. |
value | The expected value. |
Implements INodeAsserts.
Execute lamp test.
Example usage (mates_test_11.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_11
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dio3Node dio = mates.NewDio3Node(
NodeId.mates_dio3_mk1_1);
dio.LampTest();
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
Get node information as string.
- Returns
- The node information.
Example usage (mates_test_13.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_13
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
UccNode dio = mates.NewUccNode(
NodeId.mates_ucc_mk1_1);
string info = dio.NodeInfo();
Console.Write(info);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
The registers that are associated with this node. Populated by the node constructor.
Holds the device serial number.
Get string representation of this node Id (NodeId).
Get node name of this node.
The documentation for this class was generated from the following files: