.

Controller.DigitalOutSet

Sets the current state of a set of controller digital outputs.

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 bits to set.
newVal Boolean Array The state that each output bit in set will be assigned.

Common Exceptions

 
Error Occurs when...
Argument An invalid argument is specified. The specified set of bits does not exist on the controller.

Visual Basic

Syntax

Function DigitalOutSet(bitStart as UInt32, bitCount as UInt32, newVal() as Boolean)

Sample Code

 
If controller.DigitalOutAvailable(2) And _
controller.DigitalOutAvailable(3) Then Dim outputStates() As Boolean = controller.DigitalOutGet(2, 2) Console.WriteLine("Digital Output #2 State: {0}", outputStates(0)) Console.WriteLine("Digital Output #3 State: {0}", outputStates(1)) outputStates(0) = False outputStates(1) = False controller.DigitalOutSet(2, 2, outputStates)
End If


Sample Application

 

C#

Syntax

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

Sample Code

 
if (controller.DigitalOutAvailable[2] &&
controller.DigitalOutAvailable[3]) {
bool[] outputStates = controller.DigitalOutGet(2, 2); Console.WriteLine("Digital Output #2 State: {0}", outputStates[0]);
Console.WriteLine("Digital Output #3 State: {0}", outputStates[1]); outputStates[0] = false;
outputStates[1] = false; controller.DigitalOutSet(2, 2, outputStates);
}

 

See Also

 

 

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