RapidScript is a basic programming language we created to make programming motion applications simple and fun.
🛠️ Configuration
Prior to running any RapidScript application, users should configure their system properly. See the Configuration page for more information. In most cases, either using the rsiconfig utility or RapidCode functions to configure a system is preferred over using RapidScript.
- 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.
Example configuration of a phantom axis:
void ConfigurePhantomAxis(uint32 axisIndex)
{
double userUnits = 1000.0;
AxisUserUnitsSet(axisIndex, userUnits);
AxisInterruptEnableSet(axisIndex, false);
enum RSIActionNONE = 0;
AxisAmpFaultActionSet(axisIndex, RSIActionNONE);
AxisHardwareNegLimitActionSet(axisIndex, RSIActionNONE);
AxisHardwareNegLimitTriggerStateSet(axisIndex, true);
AxisHardwarePosLimitActionSet(axisIndex, RSIActionNONE);
AxisHardwarePosLimitTriggerStateSet(axisIndex, true);
AxisErrorLimitActionSet(axisIndex, RSIActionNONE);
double finePositionTolerance = 1000000.0;
AxisPositionToleranceFineSet(axisIndex, finePositionTolerance);
double coarsePositionTolerance = 1000000.0;
AxisPositionToleranceCoarseSet(axisIndex, coarsePositionTolerance);
double velocity = 100000.0;
AxisDefaultVelocitySet(axisIndex, velocity);
double acceleration = 1000000.0;
AxisDefaultAccelerationSet(axisIndex, acceleration);
AxisDefaultDecelerationSet(axisIndex, acceleration);
double jerkPercent = 50.0;
AxisDefaultJerkPercentSet(axisIndex, jerkPercent);
}
Preparing an axis for motion:
void PrepareAxisForMotion(uint32 axisIndex)
{
AxisAbort(axisIndex);
AxisClearFaults(axisIndex);
AxisPositionSet(axisIndex, 0);
AxisCommandPositionSet(axisIndex, 0);
AxisCommandPositionDirectSet(axisIndex, 0);
AxisMotionCamRepeatStop(axisIndex);
AxisGearingDisable(axisIndex);
AxisAmpEnableSet(axisIndex, true);
}
🌐 Subsections