APIs, concepts, guides, and more
General Purpose IO

Utilize general-purpose IO for versatile digital and analog input/output control across the EtherCAT network.

🔹 What are general-purpose IOs?

In the RapidCode API, when we use the term IO, we mean general-purpose digital inputs or digital outputs and analog inputs or analog outputs.

General-purpose IOs are typically connected to the EtherCAT network via slave module. Click to see the hardware list.

Here is a picture of RapidSetupX showing all available general purpose IO in the system's network:

RapidSetupX: IO Page

Note
To control dedicated IO on the drive such as: Home, Positive Limit, Negative Limit, etc. Please navigate to Dedicated IO topic documentation.

🔹 How do I get/set general-purpose IOs?

There are two ways to access general purpose digital/analog inputs/outputs:

  1. Via the NetworkNode object (recommended):
Method Returns Description
DigitalInGet bool Reads the state of a digital input
DigitalOutGet bool Reads the current state of a digital output
DigitalOutSet void Sets the state of a digital output
AnalogInGet int32_t Reads the value of an analog input channel
AnalogOutSet void Sets the value of an analog output channel
// get node
var node = controller.NetworkNodeGet(nodeNumber: 0);
Helpers.CheckErrors(node);
// digital io
bool dIn = node.DigitalInGet(digitalInNumber: 0);
bool dOut = node.DigitalOutGet(digitalOutNumber: 0);
node.DigitalOutSet(digitalOutNumber: 0, state: dOut);
// analog io
int aIn = node.AnalogInGet(analogChannel: 0);
int aOut = node.AnalogOutGet(analogChannel: 0);
node.AnalogOutSet(analogChannel: 0, analogValue: aOut);
  1. Via the IOPoint object: check out the IOPoint concept page.