CanNode.DigitalInGet
DigitalOutGet reads a series of consecutive digital input bits and returns the states as a Boolean array.
Version History
Introduced in MPX 2.0.
Result
Array of Boolean
Arguments
|
Argument |
Type |
Description |
bitStart |
UInt32 |
The first digital input bit to read. |
bitCount |
UInt32 |
The number of digital input bits to read. The last digital input read will be a bit number (bitStart + bitCount -1). |
|
Common Exceptions
|
Error |
Occurs when... |
Argument |
When bitCount exceeds 32. |
|
Visual Basic
Syntax
Function DigitalInGet(bitStart As UInt32, bitCount As UInt32) As Boolean()
Sample Code
|
Dim can As Mpx.Can = Controller.Can(0)
'Get the first node
Dim canNode As Mpx.CanNode = can.Node(can.NodeIdList(0))
'Get the number of inputs
Dim count As Integer = canNode.DigitalInCount
'Get all the digital input values
Dim values() As Boolean = canNode.DigitalInGet(0, count)
|
C#
Syntax
bool[] DigitalInGet(uint bitStart, uint bitCount);
Sample Code
|
Mpx.Can can = Controller.Can[0];
// Get the first node
Mpx.CanNode canNode = can.Node[can.NodeIdList[0]];
// Get the number of inputs
int count = canNode.DigitalInCount;
// Get all the digital input values
bool[] values = canNode.DigitalInGet(0, count);
|
See Also
DigitalInBit
Overview of MPX I/O
|