MC_GrpReadCmdPos
Description
MC_GrpReadCmdPos fills the array (specified by the Position
argument) with the commanded position of the coordinate system specified by the CoordSystem
argument. This function block does not cause any motion.
-
-
Currently, only the ACS coordinate system is supported. See Coordinate Systems to learn more.
Figure 8-174: MC_GrpReadCmdPos
There is a one to one correspondence between the axes in the Axes Group and the position values in the Position Array. Each element in the Position Array corresponds to the axis element in the Axis Group array. If an index in the Axes Group is unassigned then the position value for that array element in the Position Array will be 0. If the element does contain an axis then the position value will be filled with the current actual position for that axis. Here is an example to illustrate how this works:
-
-
This function or function block returns cached data. See Programming a Dual Core Controller for more information.
Related Function Blocks
MC_GrpReadActPos, MC_GrpReadActVel, MC_GrpReadActAcc, MC_GrpReadCmdVel
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
Enable | Description | If True, then this function block will read the current commanded position of the axes in the group |
Data type | BOOL | |
Range | 0, 1 | |
Unit | N/A | |
Default | — | |
AxesGroup | Description | The axes group from which the commanded position will be read. |
Data type | AXES_GROUP_REF | |
Range | N/A | |
Unit | N/A | |
Default | — | |
CoordSystem | Description | The coordinate system used when reading the commanded position. |
Data type | SINT | |
Range |
One of the following enumeration values:
|
|
Unit | N/A | |
Default | — | |
Position[] | Description | An array where the position data will be written. The length of the array must equal the maximum number of axes allowed in the group. The maximum number of axes is an argument to MC_CreateAxesGrp, which is used to create axes groups. |
Data type | LREAL | |
Range | N/A | |
Unit | User units | |
Default | — |
Output
Valid | Description | If true, that the positions have been read without error. |
Data type | BOOL | |
Error | Description | If true, an error has occurred. |
Data type | BOOL | |
ErrorID | Description | Indicates the error if Error output is set to TRUE. See the table in PLCopen Function Block ErrorID Output |
Data type | INT |
Example
Structured Text
(*MC_GrpReadCmdPos ST"Structured text"
A high-level language that is block structured and syntactically resembles Pascal example *)
Inst_MC_GrpReadCmdPos(DoRead, Group, CoordSys, PosList );
IL
BEGIN_IL"Instruction list" This is a low-level language and resembles assembly
CAL Inst_MC_GrpReadCmdPos( DoRead, Group, CoordSys, PosList )
END_IL
FBD
FFLD