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.
- 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.
📜 G-Code with Free Axis
Setup and run a simple G-Code program.
string gcodeProgram = "G91; Sets the programming mode to RELATIVE\n" +
"G64; Turns off exact stop mode(Default)\n" +
"G1 X1.0 Y0.0 Z0.0 A1.0 F60.0; Move on USERUNIT in positive x direction at 60in/min. Moves Free axis A to position 1.0.\n" +
"G3 X1 Y1 I0 J1; Counter clockwise arc with a center point of 0,1,0 and end point of 1,1,0 relative to the current position\n" +
"M80; Show how to use an M-code with GcodeCallback!\n";
const string xLabel = "X-Axis";
const string yLabel = "Y-Axis";
const string zLabel = "Z-Axis";
const string aLabel = "A-Axis";
Axis[] axes =
new Axis[] { x_axis, y_axis, z_axis, a_axis };
jointsMultiAxis.
AxesAdd(axes, axes.Length);
const string modelName = "RSI_XYZA";
const double scaling = 1.0, offset = 0.0;
try
{
}
catch (Exception e)
{
Console.WriteLine("Error loading G-Code: " + e.Message);
throw e;
}
Console.WriteLine(
"G-code estimated run time: " + robot.
Gcode.
DurationGet() +
" seconds");
Int64 activeLineNumber = 0;
do
{
Thread.Sleep(200);
{
Console.WriteLine("G-Code Line Number: " + activeLineNumber);
}
Learn more in the concept page.
📜 Changing Linear Units G-Code
How changing linear units affects vel and accel setters.
const string xLabel = "X-Axis";
const string yLabel = "Y-Axis";
const string zLabel = "Z-Axis";
const string aLabel = "A-Axis";
const string bLabel = "B-Axis";
const string cLabel = "C-Axis";
Axis[] axes =
new Axis[] { x_axis, y_axis, z_axis, a_axis, b_axis, c_axis };
jointsMultiAxis.
AxesAdd(axes, axes.Length);
const string modelName = "RSI_XYZABC_Centimeters";
const double scaling = 1.0, offset = 0.0;
Learn more in the concept page.