.

Controller.DigitalOutGet

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

Version History

Introduced in MPX 2.0.

Result

Boolean Array

Arguments

 
Argument Type Description
bitStart UInt32 The first digital output bit to read.
bitCount UInt32 The number of bits to read.

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 DigitalOutGet(bitStart as UInt32, bitCount as UInt32) 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

bool [] DigitalOutGet(UInt32 bitStart, UInt32 bitCount);

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