MC_AddAxisToGrp
Description
This function block adds an axis to an axes group. Both the axis and the axes group must be created prior to calling this function block. See MC_CreateAxesGrp and Create PLCopen Axis.
The IdentInGroup input specifies the index of the axis in the group. Axes do not need to be added in sequential order and gaps are acceptable. Gaps are ignored when the group is used.
The group must be in either the "GroupStandby" or "GroupDisabled" state when the axis is added. The state of the group can be read with MC_GrpReadStatus. This implies that the group cannot be moving when the axis is added.
This function block does not cause motion.
-
-
- An axes group cannot contain more than one instance of an axis.
- Two active groups cannot contain the same axis. An "active" group is one in any state other than GroupDisabled.
-
- This function block starts a motion-related action and therefore stores data for calculations and error checking. Please see Calling Function Blocks Multiple Times in the Same Cycle if you are using a dual-core controller.
Related Functions
MC_CreateAxesGrp, MC_GrpReadStatus , MC_RemAxisFromGrp, MC_UngroupAllAxes, MC_ErrorDescription
Coordinated Motion, the top-level topic for Coordinated Motion.
Arguments
For more detail on how inputs and outputs work, refer to PLCopen Function Blocks - General Rules
Input
Execute | Description | On the rising edgeA rising edge is the transition of a digital signal from low to high. It is also called positive edge the axis is added to the group. |
Data type | BOOL | |
Range | 0, 1 | |
Unit | N/A | |
Default | — | |
AxesGroup | Description | Reference to an axes group |
Data type | AXES_GROUP_REF | |
Range | — | |
Unit | N/A | |
Default | — | |
Axis | Description |
Reference to the axis to be added. An axes group cannot contain more than one instance of an axis. |
Data type | AXIS_REF | |
Range | — | |
Unit | N/A | |
Default | — | |
IdentInGroup | Description |
The zero-based index of the axis in the group.
To remove an axis from a group see MC_RemAxisFromGrp. |
Data type | UINT | |
Range | [0, MaxNumberOfAxes - 1] | |
Unit | N/A | |
Default | — |
Output
Done | Description | If True, then the command completed successfully. |
Data type | BOOL | |
Error | Description | If True, an error has occurred. |
Data type | BOOL | |
ErrorID | Description | Indicates the error identifier if Error output is set to True. See the table in PLCopen Function Block ErrorID Output. |
Data type | INT |
Example
Structured Text
(*MC_AddAxisToGrp ST"Structured text" A high-level language that is block structured and syntactically resembles Pascal example *)
Inst_MC_AddAxisToGrp (AddAxisToGrp, Group1_ref, Axis_1, 0);
IL
BEGIN_IL"Instruction list" This is a low-level language and resembles assembly CAL Inst_MC_AddAxisToGrp( AddAxisToGrp, Group1_ref, Axis_1, 0 ) END_IL
FBD
Ladder Diagram