General Rules
General rules
The following table provides general rules about the interface of the Motion Control function blocks.
| Rule applies to | Rule |
|---|---|
| Output exclusivity | When 'Execute' is true, the outputs ‘Busy’, ‘Done’, ‘Error’, and ‘CommandAborted’ are mutually exclusive. Only one of these variables can be TRUE at a given time. |
| Output status | The 'Done', 'InGear', 'InSync', 'InVelocity', 'Error', 'ErrorID' and 'CommandAborted' outputs are reset with the falling edge of 'Execute'. However, the falling edge of 'Execute' does not stop or even influence the execution of the function block. The corresponding outputs are set for at least one cycle if the situation occurs, even if execute was reset before the function block completed. If an instance of a function block receives a new 'Execute' before it finishes (as a series of commands on the same instance), the function block won’t return any feedback such as ‘Done’ or ‘CommandAborted’ for the previous action. |
| Input parameters | The parameters are read at the rising edge of the 'Execute' input. To modify any parameter, it is necessary to change the input parameter(s) and trigger the 'Execute' again. |
| Missing input parameters | According to IEC 61131-3, if any parameter of a function block input is missing (unconnected) then the value from the previous invocation of this instance will be used. In the first invocation the default value is applied. |
| Position versus distance | 'Position' is a value defined within a coordinate system. 'Distance' is a relative measure, the difference between two positions. |
| Sign rules | The 'Velocity', 'Acceleration', 'Deceleration' and 'Jerk' are always positive values. 'Position' and 'Distance' can be positive or negative. |
| Error Handling Behavior | All blocks have two outputs which report errors that may occur while executing. These outputs are defined as follows: Error: Indicates that an error has occurred during the execution of the Function Block, and its operation has stopped unsuccessfully. ErrorID: Error number - see the Function Block ErrorID List. 'Done', 'InVelocity', 'InGear', and 'InSync' indicate successful completion, so these signals are logically exclusive to 'Error'. Types of errors: • Function Block Error (e.g. parameters out of range, state machine violation attempted.) • Communication Error • Amplifier/Axis Error Instance errors do not always result in an axis error (forcing the axis to 'StandStill'.) The error outputs are reset with falling edge of 'Execute'. |
| Behavior of Done output | The 'Done' output as well as 'InGear', 'InSync' are set when the commanded action has been completed successfully. With multiple function blocks working on the same axis in a sequence, the following applies: When one movement on an axis is interrupted with another movement on the same axis without having reached the final goal, 'Done' of the first FB will not be set. |
| Behavior of CommandAborted output | 'CommandAborted' is set when a commanded motion is interrupted by another motion command. The reset-behavior of 'CommandAborted' is like that of 'Done'. When 'CommandAborted' occurs, the other output signals such as 'InVelocity' are reset. |
| Inputs exceeding application limits | If a function block is executed with parameters which result in a violation of application limits, the function block generates an error. The consequences of this error for the axis are application specific and thus should be handled by the application program. |
| Behavior of Busy output | 'Busy' output indicates that the FB is not finished. 'Busy' is SET at the rising edge of 'Execute' and RESET when one of the outputs 'Done', 'Aborted', or 'Error' is set. It is recommended that this FB should be kept in the active loop of the application program for at least as long as ‘Busy’ is true, because the outputs may still change. For one axis, several Function Blocks might be busy, but only one can be active at a time. Exceptions are 'MC_SuperImposed' and 'MC_Phasing', where more than one FB related to one axis can be active. |
| Output ‘Active’ | The 'Active' output is available on Function Blocks with buffering capabilities. This output is set at the moment the function block takes control of the axis. For unbuffered mode the outputs 'Active' and 'Busy' have the same value. |
| Enable and Valid Status | The 'Enable' input is coupled to a 'Valid' output. 'Enable' is level sensitive, and 'Valid' indicates that all other outputs are available. The 'Valid' output is TRUE if there are no errors preventing the function block from providing good outputs. The relevant output values are refreshed while the input 'Enable' is TRUE. If there is an error, Valid is set to FALSE. When the error condition disappears, the other output values will reappear and 'Valid' output will be set again. NOTE: depending on the internal design of a function block with an Enable input, an error may be considered major or minor. Minor errors automatically clear when the error condition goes away. Other Enable style function blocks may be designed to consider any errors major such that they will not resume operation without the Enable input being toggled. |
The behavior of the “Execute" / “Done" style FBs is as follows: