.

Axis.GeneralIoSet

GeneralIoSet sets a series of consecutive general purpose digital output bits to states specified by an input Boolean array.

Version History

Introduced in MPX 2.0.

Results

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 Reason
Argument When bitCount exceeds 32.

 

Visual Basic

Syntax

Sub GeneralIoSet(bitStart As UInt32, bitCount As UInt32, newVal As Boolean())

Sample Code

 
' If I/O is configured as a digital output, then the output state may be set or read. 
If (controller.Axis[0].GeneralIoConfig[0] == Mpx.IoConfig.Output) And _
   (controller.Axis[0].GeneralIoConfig[1] == Mpx.IoConfig.Output) Then

Dim newValue() As Boolean = New Boolean() { True, False }
Dim bitStart As Int32 = 0
Dim bitCount As Int32 = 2
controller.Axis(0).GeneralIoSet(bitStart, bitCount, newValue)
End If


Sample Application

 

C#

Syntax

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

Sample Code

 
// If I/O is configured as a digital output, then the output state may be set or read. 
if (controller.Axis[0].GeneralIoConfig[0] == Mpx.IoConfig.Output &&
    controller.Axis[0].GeneralIoConfig[1] == Mpx.IoConfig.Output)
{
bool[] newValue = new bool[] { true, false };
int bitStart = 0;
int bitCount = 2;
controller.Axis[0].GeneralIoSet(bitStart, bitCount, newValue);
}

 

See Also

GeneralIoBit
GeneralIoGet
GeneralIoWait

Overviews
MPX I/O Overview

 

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