.

Axis.GeneralIoConfig

Reads or sets the current state of a general purpose I/O line.

This property returns the current acting state regardless of the configuration.
If the I/O is configured as a digital output, then the output state may be set or read.
If the I/O is configured as a digital input, then the input state may only be read.

This property cannot be saved to flash memory.

Version History

Introduced in MPX 2.0.

Type

Mpx.IoConfig (read only)

Index

 
Argument Type Description
bit Long The general I/O bit to read.

 

Visual Basic

Syntax

Property GeneralIoConfig As Mpx.IoConfig(index As UInt32)

Sample Code

 
Dim xAxis As Mpx.Axis = controller.Axis(0)
Dim generalIo5Avail As Boolean = xAxis.GeneralIoAvail(5) ' Is I/O 5 available? 

If generalIo5Avail Then 
   ' Can I/O 5 be a digital input? And is I/O 5 not already an input?
   If xAxis.GeneralIoConfigAvail(5, Mpx.IoConfig.Input) And _ 
      xAxis.GeneralIoConfig(5) <> Mpx.IoConfig.Input Then

       ' Force I/O 5 to be a digital input
       xAxis.GeneralIoConfig(5) = Mpx.IoConfig.Input 
   End If 
End If 

 

C#

Syntax

Mpx.IoConfig[] GeneralIoConfig;

Sample Code

 
Mpx.Axis xAxis = controller.Axis[0];
bool generalIo5Avail = xAxis.GeneralIoAvail[5]; // Is I/O 5 available? 

if (generalIo5Avail)
{
   // Can I/O 5 be a digital input? And is I/O 5 not already an input?
   if (xAxis.GeneralIoConfigAvail(5, Mpx.IoConfig.Input) && 
      xAxis.GeneralIoConfig(5) <> Mpx.IoConfig.Input)
   {
       // Force I/O 5 to be a digital input
       xAxis.GeneralIoConfig[5] = Mpx.IoConfig.Input;
   }
}
              

 

 

See Also

GeneralIoAvailable
GeneralIoConfigAvailable
GeneralIoName

 

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