APIs, concepts, guides, and more
io-iopoint.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 use IOPoint objects to read and write network data.
Shows how to create IOPoint objects for digital outputs and use them to control IO.
Requires an EtherCAT network with nodes that have digital outputs.
*/
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 IO: IOPoint Objects");
// get rmp objects
try
{
Helpers.CheckErrors(controller);
const int NODE_INDEX = 0; // the EtherCAT Node we will be communicating with
const int OUTPUT_INDEX = 0; // the PDO Index in that Node
// create IOPoint for digital output - automatically gets memory index of specified node and output index
IOPoint output0 = IOPoint.CreateDigitalOutput(controller.NetworkNodeGet(NODE_INDEX), OUTPUT_INDEX);
// set the output to false
output0.Set(false);
Console.WriteLine($"Output {OUTPUT_INDEX} set to: false");
// wait one sample for the change to take effect
controller.SampleWait(1);
// read back the value
bool outputValue = output0.Get();
Console.WriteLine($"Output {OUTPUT_INDEX} value: {outputValue}");
// set the output to true
output0.Set(true);
Console.WriteLine($"Output {OUTPUT_INDEX} set to: true");
controller.SampleWait(1);
outputValue = output0.Get();
Console.WriteLine($"Output {OUTPUT_INDEX} value: {outputValue}");
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
void Set(bool state)
Set the state of a Digital Output.
static IOPoint * CreateDigitalOutput(Axis *axis, RSIMotorDedicatedOut motorDedicatedOutNumber)
Create a Digital Output from an Axis' Dedicated Output bits.
bool Get()
Get the state of Digital Input or Output.
Represents one specific point: Digital Output, Digital Input, Analog Output, or Analog Input....
Definition rsi.h:11550
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