MC_TransformPosition
- This function block calculates a coordinate transformation.
- A position specified in the origin coordinate system is returned in the target coordinate system.
- An origin mover template object refers to the origin coordinate system.
- A destination mover template object refers to the target coordinate system.
- Object ID 0,
Oid = 0
, refers to the absolute coordinate system. - The origin mover template object can refer to the absolute coordinate system, and the destination mover template object can refer to the coordinate system of the Tool Center Point: thus, a calculation of the coordinate transformation from the coordinate system of the Tool Center Point to the absolute coordinate system is to be performed.
- The origin mover template object can refer to the coordinate system of the Tool Center Point, and the destination mover template object can refer to the absolute coordinate system: thus, a calculation of the coordinate transformation from the coordinate system of the Tool Center Point to the absolute coordinate system is to be performed.
- For information purposes only: without effect on the setpoints.
Inputs
VAR_INPUT
Execute : BOOL;
OriginOid : OTCID;
DestinationOid : OTCID;
OriginPosition : MC_LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | This function block outputs the target position when a rising edge is triggered at input |
OriginOid | OTCID | This input refers to the origin mover template object as a coordinate system reference. |
DestinationOid | OTCID | This input refers to the target mover template object as a coordinate system reference. |
OriginPosition | MC_LREAL | Position value in the frame of the coordinate system to which the origin mover template object refers. |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorId : UDINT;
DestinationPosition : MC_LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | This output becomes |
Busy | BOOL | This output becomes |
Error | BOOL | This output becomes |
ErrorId | UDINT | Contains the command-specific error code of the last executed command. |
DestinationPosition | MC_LREAL | Position value within the coordinate system to which the destination mover template object refers. |
Sample
VAR
fbAbsoluteToTcp : MC_TransformPosition;
fbTcpToAbsolute : MC_TransformPosition;
inputPositionAbsolute : LREAL;
inputPositionTcp : LREAL;
outputPositionTcp : LREAL;
outputPositionAbsolute : LREAL;
oidMoverTemplate : OTCID;
END_VAR
fbAbsoluteToTcp(
Execute := TRUE,
OriginOid := 0, //absolute
DestinationOid := oidMoverTemplate,
OriginPosition := inputPositionAbsolute,
DestinationPosition => outputPositionTcp
);
fbTcpToAbsolute(
Execute := TRUE,
OriginOid := oidMoverTemplate,
DestinationOid := 0, //absolute
OriginPosition := inputPositionTcp,
DestinationPosition => outputPositionAbsolute
);
Requirements
Development environment | Target platform | PLC libraries |
---|---|---|
TwinCAT V3.1.4022.25 TF5400 Advanced Motion Pack V3.1.6.07 | PC or CX (x64) | Tc3_McCollisionAvoidance, |