.

Recorder.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 a 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 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 outputs
Dim count As Integer = canNode.DigitalOutCount

'Get all the digital input values
Dim values() As Boolean = canNode.DigitalOutGet(0, count)

'Set the value of the 4th bit
values(3) = True
canNode.DigitalOutSet(3, 1, values)

 

C#

Syntax

void DigitalOutSet(uint bitStart, uint bitCount, bool[] newVal);

Sample Code

 
Mpx.Can can = Controller.Can[0];

// Get the first node
Mpx.CanNode canNode = can.Node[can.NodeIdList[0]];

// Get the number of outputs
int count = canNode.DigitalOutCount;

// Get all the digital input values
bool[] values = canNode.DigitalOutGet(0, count);

// Set the value of the 4th bit
values[3] = true;
canNode.DigitalOutSet(3, 1, values);

 

See Also

DigitalOutBit
DigitalOutGet
DigitalOutWait

Overview of MPX I/O

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering