APIs, concepts, guides, and more
io-iopoint-user-buffer.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 create simulated IOPoints using user buffer memory.
Shows how to create IOPoint objects from base memory addresses and test their functionality
without requiring actual network IO hardware.
*/
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 IO: IOPoint User Buffer");
// get rmp objects
try
{
Helpers.CheckErrors(controller);
const int INPUT_INDEX = 0;
const int OUTPUT_INDEX = 1; // the PDO Index in the user buffer
// get user buffer address for simulated IO point storage
UInt64 userBufferAddress = controller.AddressGet(RSIControllerAddressType.RSIControllerAddressTypeUSER_BUFFER, 0);
// create simulated IOPoints based on memory address and index
IOPoint input0 = IOPoint.CreateDigitalInput(controller, userBufferAddress, INPUT_INDEX);
IOPoint output0 = IOPoint.CreateDigitalOutput(controller, userBufferAddress, OUTPUT_INDEX);
// get & set an output
bool outVal = output0.Get();
output0.Set(outVal);
Console.WriteLine($"Output 0 value: {outVal}");
// test input operations by directly writing to memory
controller.MemorySet(input0.AddressGet(), 1);
bool inVal = input0.Get();
Console.WriteLine($"Input 0 memory set to 1, value: {inVal}");
controller.MemorySet(input0.AddressGet(), 0);
inVal = input0.Get();
Console.WriteLine($"Input 0 memory set to 0, value: {inVal}");
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
uint64_t AddressGet()
Get the Host Address for the I/O point.
void Set(bool state)
Set the state of a Digital Output.
static IOPoint * CreateDigitalInput(Axis *axis, RSIMotorDedicatedIn motorDedicatedInNumber)
Create a Digital Input from an Axis' Dedicated Input bits.
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
RSIControllerAddressType
Used to get firmware address used in User Limits, Recorders, etc.
Definition rsienums.h:405
Helpers namespace provides utility functions for common tasks in RMP applications.
Definition helpers.h:21