MC_GrpReadActPos
Description
MC_GrpReadActPos fills the array specified by the ‘Position’ argument with the actual position of the system in 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 7-165: MC_GrpReadActPos
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 Functions
MC_GrpReadActVel, MC_GrpReadActAcc, MC_GrpReadCmdPos, 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 actual 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 actual 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 actual 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 the CreateAxesGrp function block that is used to create axes groups. |
Data type | LREAL | |
Range | n/a | |
Unit | User units | |
Default | — |
Output
Valid | Description | If true, 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 PLCopen Function Block ErrorID Output |
Data type | INT |
Example
Structured Text
Inst_MC_GrpReadActPos( DoRead, Group, CoordSys, PosList );
IL
BEGIN_IL"Instruction list" This is a low-level language and resembles assembly CAL Inst_MC_GrpReadActPos( DoRead, Group, CoordSys, PosList ) END_IL
FBD
Ladder Diagram