APIs, concepts, guides, and more
io-network-pdo-sdo.cs
Note
See IO: Input & Output 📜 for a detailed explanation of this sample code.
Warning
This is a sample program to assist in the integration of the RMP motion controller with your application. It may not contain all of the logic and safety features that your application requires. We recommend that you wire an external hardware emergency stop (e-stop) button for safety when using our code sample apps. Doing so will help ensure the safety of you and those around you and will prevent potential injury or damage.

The sample apps assume that the system (network, axes, I/O) are configured prior to running the code featured in the sample app. See the Configuration page for more information.
/* This sample demonstrates how to read network inputs and outputs (PDOs and SDOs).
Shows how to enumerate through all network inputs/outputs and read their properties,
including size, offset, name, and value information.
*/
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 IO: Network PDOs and SDOs");
// get rmp objects
try
{
Helpers.CheckErrors(controller);
// get Input values
int inputCount = controller.NetworkInputCountGet(); // get number of Network Inputs (PDOs)
Console.WriteLine($"Network Input Count: {inputCount}");
for (int i = 0; i < inputCount; i++)
{
int size = controller.NetworkInputBitSizeGet(i); // read Input BitSize
int offset = controller.NetworkInputBitOffsetGet(i); // read Input BitOffset
string name = controller.NetworkInputNameGet(i); // read Input Name
UInt64 value = controller.NetworkInputValueGet(i); // read Input Value
Console.WriteLine($"Input {i}: {name}, Size: {size}, Offset: {offset}, Value: {value}");
}
// get Output values
int outputCount = controller.NetworkOutputCountGet(); // get number of Network Outputs (SDOs)
Console.WriteLine($"Network Output Count: {outputCount}");
for (int i = 0; i < outputCount; i++)
{
int size = controller.NetworkOutputBitSizeGet(i); // read Output BitSize
int offset = controller.NetworkOutputBitOffsetGet(i); // read Output BitOffset
string name = controller.NetworkOutputNameGet(i); // read Output Name
UInt64 value = controller.NetworkOutputSentValueGet(i); // read Output Value
Console.WriteLine($"Output {i}: {name}, Size: {size}, Offset: {offset}, Value: {value}");
controller.NetworkOutputOverrideValueSet(i, value);
}
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
static MotionController * Get()
Get an already running RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
Definition rsi.h:800
Helpers namespace provides utility functions for common tasks in RMP applications.
Definition helpers.h:21