.

Controller.DigitalInGet

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

Version History

Introduced in MPX 2.0.

Result

Boolean Array

Arguments

 
Argument Type Description
bitStart UInt32 The first digital input 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 DigitalInGet(bitStart as UInt32, bitCount as UInt32) As Boolean()

Sample Code

 
If controller.DigitalInAvailable(0) And _
controller.DigitalInAvailable(1) Then Dim inputStates() As Boolean = controller.DigitalInGet(0, 2) Console.WriteLine("Digital Input #0 State: {0}", inputStates(0)) Console.WriteLine("Digital Input #1 State: {0}", inputStates(1))
End If


Sample Application

 

C#

Syntax

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

Sample Code

 
if (controller.DigitalInAvailable[0] && 
controller.DigitalInAvailable[1] )
{
bool[] inputStates = controller.DigitalInGet(0, 2); Console.WriteLine("Digital Input #0 State: {0}", inputStates[0]); Console.WriteLine("Digital Input #1 State: {0}", inputStates[1]);
}

 

See Also

 

 

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