Represents single MATES-DAC5-MK1 node.
More...
|
RegList | Registers |
| The registers that are associated with this node. Populated by the node constructor. More...
|
|
Represents single MATES-DAC5-MK1 node.
The Dac5Node constructor is not intended to be called directly. Use Mates.NewDac5Node instead.
override double GetDacMaximum |
( |
int |
channel | ) |
|
|
virtual |
Get the maximum allowable value of the DAC.
- Parameters
-
channel | The DAC channel number [0,39] |
- Returns
- The DAC maximum value in Volts.
Implements DacNode.
override double GetDacMinimum |
( |
int |
channel | ) |
|
|
virtual |
Get the minimum allowable value of the DAC.
- Parameters
-
channel | The DAC channel number [0,39] |
- Returns
- The DAC minimum value in Volts.
Implements DacNode.
void SetDac |
( |
int |
channel, |
|
|
double |
voltage |
|
) |
| |
|
inherited |
Set the value of the DAC. Takes calibration data into account.
- Parameters
-
channel | The DAC channel number [0,39] |
voltage | The voltage value to set (Volts). |
Example usage (mates_test_03.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_03
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dac5Node dac = mates.NewDac5Node(
NodeId.mates_dac5_mk1_1);
Adc5Node adc = mates.NewAdc5Node(
NodeId.mates_adc5_mk1_1);
dac.SetDac(5, 1.0);
double check = adc.GetAdc(5);
Assert.IsTrue(check >= 0.99 && check <= 1.01);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
Implements IDacNode.
void SetDacRaw |
( |
int |
channel, |
|
|
int |
val |
|
) |
| |
|
inherited |
Set raw value of the DAC.
- Parameters
-
channel | The DAC channel number [0,39]. |
val | The raw DAC binary code to write. |
Example usage (mates_test_04.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_04
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dac5Node dac = mates.NewDac5Node(
NodeId.mates_dac5_mk1_1);
dac.SetDacRaw(0, 65536 / 2);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
Implements IDacNode.
double GetDac |
( |
int |
channel | ) |
|
|
inherited |
Get the value of the DAC.
- Parameters
-
channel | The DAC channel number [0,39] |
- Returns
- The DAC value in Volts.
Implements IDacNode.
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: