Controller Interrupts sample application.
- 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.
- Precondition
- This sample code presumes that the user has set the tuning paramters(PID, PIV, etc.) prior to running this program so that the motor can rotate in a stable manner.
📜 Controller Interrupt
#include "rsi.h"
#include "SampleAppsHelper.h"
void controllerInterruptsMain()
{
const int TIMEOUT = (5000);
controller->InterruptEnableSet(true);
try
{
{
interruptType = controller->InterruptWait(TIMEOUT);
{
printf("IRQ %ld\n", interruptType);
printf("%s\n", controller->InterruptNameGet());
printf("InterruptSourceNumber = %ld\n", controller->InterruptSourceNumberGet());
printf("InterruptSampleTimer = %ld\n", controller->InterruptSampleTimeGet());
printf("\n");
}
else
{
printf("Timeout waiting for interrupts...\n");
}
}
}
{
printf("\n%s\n", err.text);
}
controller->Delete();
system("pause");
}
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
Represents the error details thrown as an exception by all RapidCode classes. This class contains an ...
RSIEventType
Event Types or Status Bits.
@ RSIWaitPOLL
return immediately, use polling
static void CheckErrors(RapidCodeObject *rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
static void StartTheNetwork(MotionController *controller)
Starts the network communication for the given MotionController.