Run Motion Macro
After a Motion Macro has been saved, a Run Motion Macro command is used to allow an XBot to run the saved commands in the Macro.
If a Motion Macro has not been saved, this command can be used to make a Motion Macro call itself, by setting the input XbotID = MacroID. In this case, the Motion Macro will be an infinite loop, and the Motion Macro is automatically saved after sending this command.

Fieldbus Interface
PMC_RunMacro
Ethernet Interface
PMCRTN RunMotionMacro(ushort cmdLabel, int motionMacroID, int xbotID)
Conditions
Operating Conditions | |
---|---|
Preconditions | Macro is in the saved state, or macro is in the unsaved state, and Input XbotID = MacroID. XBot is in the Idle state, Obstacle Detected state, Motion state, Stopped state, Hold Position state, or Waiting state. |
Postconditions | If the XBot is ready to immediately begin executing the command, then the XBot will enter the Motion state. Otherwise, the XBot state remains unchanged, but the command will be added to the XBot's motion buffer. If input XbotID = MacroID, then the run macro command will be added to the specified macro, and the macro will be saved. |
Description
After a Motion Macro has been saved, a Run Motion Macro command is used to allow an XBot to run the saved commands in the Macro.
A Run Motion Macro command can be placed into an XBot’s motion command buffer.
Once an XBot begins executing this command, it will follow all the saved commands in the Macro in sequence.
The diagram below illustrates the system operation when a Run Macro command includes another Run Macro command.
An XBot running Macro 1 will run Actions 1 & 2, followed by Actions A & B, and finally Actions 4 & 5.
If a Motion Macro has not been saved, this command can be used to make a Motion Macro call itself, by setting the input XbotID = MacroID. In this case, the Motion Macro will be an infinite loop, and the Motion Macro is automatically saved after sending this command.
An XBot running Macro 3 will run Action 3A, then 3B, followed by 3A and 3B, repeating infinitely until a Stop XBot command is used or an error occurs.