APIs, concepts, guides, and more
General Purpose IO

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

🔹 What are general-purpose IOs?

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

General-purpose I/O’s are typically connected to the EtherCAT network via slave module. Click to see the hardware list.

Note
To control dedicated I/O’s on drive such as Home, Positive Limit, Negative Limit, please read Dedicated IO topic documentation.

🔹 Important to Understand

Motion Controller Class

Represents the PCI motion controller board or the RMP INtime soft motion controller. This class provides an interface to general controller configuration, firmware upload/download, network, and data recording.

Axis Class

Represents a single axis of motion control. This class provides an interface for commanding motion, reading trajectory parameters, configuring filter (control law) parameters, homing, limit switch configuration, motor configuration, position capture, electronic gearing and Node information.

IO Class

This class provides an interface to an I/O Node. An I/O node can have various combinations of digital or analog inputs and outputs.

IO Objects have access to NetworkNode Functions.

IOPoint Class

This class provides a common interface to any I/O Point, regardless of where it resides: Motion Controller, Axis, or I/O Node.

It represents a point class. An IO Point object can be any specific Digital Output, Digital Input, Analog Output, or Analog Input

Classes Overview

🔹 Example 1: EtherCAT Network IO Modules

1. Create a Motion Controller

MotionController controller = MotionController.CreateFromSoftware();
Or
MotionController controller = MotionController.CreateFromSoftware("C:\\RSI\\X.X.X\\");
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.

2. Create Your Node Object

IO ioNode = Controller.IOGet(Int nodeNumber);
ioNode.NetworkNode.RapidCodeNetworkNodeFunction();
Or
Axis myAxis = controller.AxisGet(Int nodeNumber);
myAxis.NetworkNode.RapidCodeNetworkNodeFunction();
NetworkNode * NetworkNode
Gets the associated NetworkNode object.
Definition rsi.h:5543
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.

3. Access Specific IO Point

ioNode.NetworkNode.DigitalOutGet(int digitalOutputNumber)
Or
IOPoint DI1 = IOPoint.CreateDigitalOutput(IO ioNode, int bitNumber)

🔹 Example 2: PDO Digital Inputs/Outputs

Note
PDOs (Process Data Objects) are memory addresses that are exchanged cyclically with our drive. \ PDO’s are typically used to read/write addresses on a drive. However to access dedicated IO’s on a drive, refer to Dedicated IO concept.\ To see which PDO’s are being exchanged between the master (RMP EtherCAT motion controller) and your slave (EtherCAT device) go to: \ RapidSetup → Tools → NetworkIO

1 .Create a Motion Controller

MotionController controller = MotionController.CreateFromSoftware()

2. Get Output or Input Memory Address from PDO List

ulong inputAddress = controller.NetworkInputAddressGet(INPUT_INDEX);
Or
ulong outputAddress = controller.NetworkOutputAddressGet(OUTPUT_INDEX);
uint64_t NetworkOutputAddressGet(int32_t index)
Returns an Address of a Network Output.
uint64_t NetworkInputAddressGet(int32_t index)
Note
To check your IO indexes go to: RapidSetup --> Tools --> Network Data