General Rules

General Rules
Output exclusivity

The outputs Busy, Done, Error, and CommandAborted are mutually exclusive:

Only one of them can be TRUE on one Function Block. If Execute is TRUE, one of these outputs has to be TRUE. Only one of the outputs Active, Error, Done and CommandAborted is set at the same time.

Output status The outputs Done, InGear, InSync, InVelocity, Error, ErrorID and CommandAborted are reset with the falling edge of Execute. However, the falling edge of Executedoes not stop or even influence the execution of the actual Function Block. It must be guaranteed that 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 has finished (as a series of commands on the same instance), the Function Block will not return any feedback, like Done or CommandAborted, for the previous action.
Input parameters The parameters are used with the rising edge of the execute input. To modify any parameter it is necessary to change the input parameter(s) and to trigger the motion again.
Missing input parameters According to IEC 61131-3, if any parameter of a Function Block input is missing (open) then the value from the previous invocation of this instance will be used. In the first invocation the initial value is applied.
Position versus distance Position is a value defined within a coordinate system. Distance is a relative measure re-lated to technical units. Distance is the difference between two positions.
Sign rules Velocity, Acceleration, Deceleration and Jerk are always positive values. Position and Distance can be both positive and negative.
Error Handling Behavior All Function Blocks have two outputs, which deal with errors that can occur while executing that Function Block. These outputs are defined as follow:

Error Rising edge of Error informs that an error occurred during the execution of the Function Block.

ErrorID: Error number

The outputs Done, InVelocity, InGear, and InSync mean successful completion so these signals are logically exclusive to Error.

Types of errors:

  • Function Blocks (e.g. parameters out of range, state machine violation attempted),
  • Communication,
  • Drive Instance errors do not always result in an axis error (bringing the axis to StandStill). The error outputs of the relevant Function Block are reset with falling edge of Execute.
Function Block Naming In case of multiple libraries within one system (to support multiple drive/ motion control systems), the Function Block naming may be changed to MC_FunctionBlockName_SupplierID.
Behavior of Done output

The outputs Done, 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 Function Block 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 commanded with parameters which result in a violation of application limits, the instance of 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

Every Function Block can have an output Busy, reflecting that the Function Block 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 Function Block 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 Function Block related to one axis can be active.

Output Active The output Active is required on buffered Function Blocks. This output is set at the moment the Function Block takes control of the motion of the according axis. For un-buffered mode the outputs Active and Busy can have the same value.
Enable and Valid/Status The input Enable is coupled to output Valid. Enable is level sensitive, and Valid shows that a valid set of outputs is available at the Function Block. The output Valid is TRUE as long as an output value of Valid is available and the input Enable is TRUE. The relevant output value can be refreshed as long as the input Enable is TRUE. If there is a Function Block error, the output is not Valid (Valid set to FALSE). When the error condition disappears, the values will reappear and output Valid will be set again.
../_images/d60d286f2c0360c00a33139000e65c29

Behavior of the Execute/Done style Function Blocks.