SqNodeSegment.DigitalOutSet
DigitalOutSet sets a series of consecutive digital output bits to states specified by an input Boolean array.
Version History
Introduced in MPX 2.0.
Result
Void
Arguments
|
Argument |
Type |
Description |
bitStart |
UInt32 |
The first digital output bit to set. |
bitCount |
UInt32 |
The number of digital output bits to set. The last digital output set will be bit number (bitStart + bitCount -1). |
newVal |
Array of Boolean |
The array of Boolean values to set the digital outputs to. |
|
Common Exceptions
|
Error |
Occurs when... |
Argument |
When bitCount exceeds 32. |
|
Visual Basic
Syntax
Sub DigitalOutSet(bitStart As UInt32, bitCount As UInt32, newVal As Boolean())
Sample Code
|
Dim sqNode As Mpx.SqNode = Controller.SynqNet(0).Node(2)
Dim sqSegment As Mpx.SqNodeSegment = sqNode.Segment(1)
'Get the number of outputs
Dim count As Integer = sqSegment.DigitalOutCount
'Get all the digital output values
Dim values() As Boolean
values = sqSegment.DigitalOutGet(0, count)
'Set one value
values(3) = True
sqSegment.DigitalOutSet(3, 1, values)
|
Sample Application
C#
Syntax
void DigitalOutSet(uint bitStart, uint bitCount, bool[] newVal);
Sample Code
|
Mpx.SqNode sqNode = Controller.SynqNet[0].Node[2];
Mpx.SqNodeSegment sqSegment = sqNode.Segment[1];
// Get the number of outputs
int count = sqSegment.DigitalOutCount;
// Get all the digital output values
bool[] values = sqSegment.DigitalOutGet(0, count);
// Set one value
values[3] = true;
sqSegment.DigitalOutSet(3, 1, values);
|
See Also
DigitalOutBit
DigitalOutGet
DigitalOutWait
Overviews
Overview of MPX I/O
|