Represents single MATES-DIOX-MK1 node.
More...
|
RegList | Registers |
| The registers that are associated with this node. Populated by the node constructor. More...
|
|
|
void | InputSet (int channel) |
| Asserts that the specified input channel is in high state. More...
|
|
void | OutputSet (int channel) |
| Asserts that the specified output channel is in high state. More...
|
|
void | InputEquals (int channel, bool state) |
| Asserts that the specified input channel is in the given state. More...
|
|
Represents single MATES-DIOX-MK1 node.
The DioxNode constructor is not intended to be called directly. Use Mates.NewDioxNode instead.
void SetDout |
( |
int |
channel, |
|
|
bool |
value |
|
) |
| |
|
inherited |
Set value of an individual digital output.
- Parameters
-
channel | The DOUT channel number [0,19]. |
value | The output value. |
Example usage (mates_test_06.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_06
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dio3Node node = mates.NewDio3Node(
NodeId.mates_dio3_mk1_1);
foreach (var val in new bool[]{false, true, false})
{
node.SetDout(0, val);
node.Assert.InputEquals(0, val);
}
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
void SetDoutAll |
( |
int |
value | ) |
|
|
inherited |
Set value of all digital outputs.
- Parameters
-
value | The output value, LSB is OUT01. |
Example usage (mates_test_05.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_05
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dio3Node dio = mates.NewDio3Node(
NodeId.mates_dio3_mk1_1);
dio.SetDoutAll(0xCAFE);
Assert.AreEqual(dio.GetDinAll(), 0xCAFE);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
bool GetDout |
( |
int |
channel | ) |
|
|
inherited |
Get value of an individual digital output.
- Parameters
-
channel | The DOUT channel number [0,19]. |
- Returns
- The result.
Example usage (mates_test_07.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_07
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dio3Node dio = mates.NewDio3Node(
NodeId.mates_dio3_mk1_1);
dio.SetDout(10, true);
Assert.AreEqual(dio.GetDout(10),
true);
dio.SetDout(10, false);
Assert.AreEqual(dio.GetDout(10),
false);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
Get value of all digital outputs.
- Returns
- The result, LSB is OUT01.
Example usage (mates_test_08.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_08
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dio3Node dio = mates.NewDio3Node(
NodeId.mates_dio3_mk1_1);
Assert.IsTrue(dio.GetDoutAll() <= 0xFFFFF);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
bool GetDin |
( |
int |
channel | ) |
|
|
inherited |
Get value of an individual digital input.
- Parameters
-
channel | The DIN channel number [0,19]. |
- Returns
- The result.
Example usage (mates_test_09.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_09
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dio3Node dio = mates.NewDio3Node(
NodeId.mates_dio3_mk1_1);
for (Mates.MatesInput input = Mates.MatesInput.IN01;
input <= Mates.MatesInput.IN20;
input++)
{
Console.Write("Input {0}: {1}\n", input, dio.GetDin((int)input));
}
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
Get value of all digital inputs.
- Returns
- The result, LSB is IN01.
Example usage (mates_test_10.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_10
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dio3Node dio = mates.NewDio3Node(
NodeId.mates_dio3_mk1_1);
int output = dio.GetDoutAll();
int input = dio.GetDinAll();
dio.SetDoutAll((output & 0xFFF00) | (input & 0xFF));
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}
void InputSet |
( |
int |
channel | ) |
|
|
protectedinherited |
Asserts that the specified input channel is in high state.
- Parameters
-
channel | The input channel number [0, 19]. |
Implements IDioAsserts.
void OutputSet |
( |
int |
channel | ) |
|
|
protectedinherited |
Asserts that the specified output channel is in high state.
- Parameters
-
channel | The output channel number [0, 19]. |
Implements IDioAsserts.
void InputEquals |
( |
int |
channel, |
|
|
bool |
state |
|
) |
| |
|
protectedinherited |
Asserts that the specified input channel is in the given state.
- Parameters
-
channel | The input channel number [0, 19]. |
state | The expected state. |
Implements IDioAsserts.
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.
Represents collection of UnitTestFramework - compatible asserts defined for this type of node.
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: