Learn how to use IO.
- 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.
π Dedicated IO
This application demonstrates how to access Dedicated IO.
Console.WriteLine("RSIMotorDedicatedInLIMIT_HW_NEG: {0} and {1}",
Console.WriteLine("RSIMotorDedicatedInLIMIT_HW_POS: {0} and {1}",
Console.WriteLine("RSIMotorDedicatedInHOME: {0} and {1}",
Console.WriteLine("RSIMotorDedicatedInAMP_FAULT: {0} and {1}",
Console.WriteLine("RSIMotorDedicatedInAMP_ACTIVE: {0} and {1}",
Learn more in the concept page.
π Network Inputs and Outputs
This sample apps will demonstrate how to read the different values from your system's interchangeable PDOs and SDOs.
for (int i = 0; i < inputCount; i++)
{
}
for (int i = 0; i < outputCount; i++)
{
}
Learn more in the concept page.
π IO Points
This sample apps will demonstrate how to use the IO point object to read and write to network data.
const int NODE_INDEX = 0;
const int OUTPUT_INDEX = 0;
Assert.That(output0.
Get(), Is.False,
"The getter function should return a value equal to false");
Learn more in the concept page.
π Single Axis Sync Outputs
This sample application will show you a basic demonstration on how to set up Sync Outputs, so that you can easily change any IOβs state based on a specified point index (or ElmentID) on your steaming motion.
const int TOTAL_POINTS = 4;
const int EMPTY_CT = -1;
const int OUTPUT_INDEX = 0;
const int NODE_INDEX = 0;
double[] positions = { 1.0, 2.0, 3.0, 4.0 };
double[] times = { 0.5, 0.1, 0.2, 0.4 };
int outputEnableID = 2;
int outputDisableID = 3;
axis.
MovePT(
RSIMotionType.RSIMotionTypePT, positions, times, TOTAL_POINTS, EMPTY_CT,
false,
true);
{
{
Assert.That(output0.
Get(), Is.EqualTo(
true),
"The output should be triggered");
}
else
{
Assert.That(output0.
Get(), Is.EqualTo(
false),
"The output should NOT be triggered");
}
}
Learn more in the concept page.
π IO Point User Buffer
This sample application will show you how to create a simulated IOPoint from base on a memory address and index.
const int INPUT_INDEX = 0;
const int OUTPUT_INDEX = 1;
Assert.That(output0.
Get(), Is.False,
"The getter function should return a value equal to false");
Assert.That(output0.
Get(), Is.True,
"The getter function should return a value equal to true");
Assert.That(input0.
Get(), Is.False,
"The getter function should return a value equal to false");
Assert.That(input0.
Get(), Is.True,
"The getter function should return a value equal to true");
Learn more in the concept page.