- 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.
Console.WriteLine("📜 IO: General Purpose");
try
{
var node = controller.NetworkNodeGet(nodeNumber: 0);
bool dIn = node.DigitalInGet(digitalInNumber: 0);
bool dOut = node.DigitalOutGet(digitalOutNumber: 0);
node.DigitalOutSet(digitalOutNumber: 0, state: dOut);
int aIn = node.AnalogInGet(analogChannel: 0);
int aOut = node.AnalogOutGet(analogChannel: 0);
node.AnalogOutSet(analogChannel: 0, analogValue: aOut);
Console.WriteLine($"Digital Input 0: {dIn}");
Console.WriteLine($"Digital Output 0: {dOut}");
Console.WriteLine($"Analog Input 0: {aIn}");
Console.WriteLine($"Analog Output 0: {aOut}");
}
finally
{
controller.Delete();
}
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...
Helpers namespace provides utility functions for common tasks in RMP applications.