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):

    const int nodeIndex = 0;
    const int digitalInIndex = 0;
    const int digitalOutIndex = 0;
    const int analogIndex = 0;
    // get node
    NetworkNode node = controller.NetworkNodeGet(nodeIndex);
    // digital io
    bool dIn = node.DigitalInGet(digitalInIndex);
    bool dOut = node.DigitalOutGet(digitalOutIndex);
    node.DigitalOutSet(digitalOutIndex, true);
    // analog io
    int aIn = node.AnalogInGet(analogIndex);
    int aOut = node.AnalogOutGet(analogIndex);
    node.AnalogOutSet(analogIndex, 1234);
  2. Via the IOPoint object: check out the IOPoint concept page.