Click or drag to resize

RAPID execution

Start and Stop RAPID programs

You can start and stop RAPID execution using Rapid.Start and Stop methods. A StartResult from the Start method returns the result of the call. Start arguments can be used. RegainMode defines how the mechanical unit should handle path status at start. ExecutionMod specifies if the program should run continuously, step backward or go to the next Move instruction and so on.

The Stop method can include a StopMode argument, specifying when the program should stop (after current cycle, after completed instruction or immediately).

C#
aController.Rapid.Start(RegainMode.Regain, ExecutionMode.Continuous);

.....

aController.Rapid.Stop(StopMode.Instruction);
VB
aController.Rapid.Start(RegainMode.Regain, ExecutionMode.Continuous)

.....

aController.Rapid.Stop(StopMode.Instruction)
Note Note

It is also possible to start a service routine or an ordinary routine without any parameters as if it were a service routine. For more information and code samples, see Task.CallRoutine and Task.CancelRoutine in the Reference Manual FlexPendant SDK.

RAPID execution change event

It is possible to subscribe to events that occur when a RAPID program starts to execute and when it stops. This is done on the Rapid property of the Controller object, like this:

C#
aController.Rapid.ExecutionStatusChanged += new ExecutionStatusChangedEventHandler(UpdateUI);
VB
AddHandler aController.Rapid.ExecutionStatusChanged, AddressOf UpdateUI

For more information and code example on how write the event handlers needed to update the GUI due to a controller event, see Letting the user know that RAPID data has changed.

ResetProgramPointer method

The ResetProgramPointer method resets the program pointers of all tasks and sets them to the main entry point of the respective task.

C#
aController.Rapid.ResetProgramPointer();
VB
aController.Rapid.ResetProgramPointer()
Note Note

It is also possible to set the program pointer to a specified routine, row or position. For more information and code samples, see Task.SetProgramPointer in the Reference Manual FlexPendant SDK.