Represents single MATES-UCC-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-UCC-MK1 node.
The UccNode constructor is not intended to be called directly. Use Mates.NewUccNode instead.
void AlcdWrite |
( |
int |
row, |
|
|
int |
col, |
|
|
string |
text |
|
) |
| |
Write text onto the alphanumeric LCD display.
- Parameters
-
row | The LCD row number (0 - based). |
col | The LCD column number (0 - based). |
text | The text to write at the given position. |
Example usage (mates_test_14.cs):
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unit_tests
{
[TestClass]
public class mates_test_14
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
UccNode ucc = mates.NewUccNode(
NodeId.mates_ucc_mk1_1);
ucc.AlcdWrite(0, 0, "CS test!");
}
catch (Exception ex)
{
Console.Write("Cannot discover node: " + ex + "\n");
}
}
}
}
}
double GetAdc |
( |
int |
channel | ) |
|
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 | ) |
|
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.
Get number of channels of the ADC.
- Returns
- The number of channels.
Implements IAdcNode.
PhysicalValue GetRangeMax |
( |
int |
channel | ) |
|
Get the maximum value of a channel.
- Parameters
-
- Returns
- The maximum value in Volts, Amperes or Degrees Centigrade.
Implements IAdcNode.
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: