The method CreateTargetOnEntity creates a target on the specified entity.
The inputs i_udiTargetId and i_udiEntityId are valid.
If i_udiEntityId refers to a conveyor, then also provide a valid reference position i_lrReferencePosition.
Define the entity ID within the ranges defined for the category of the mechatronic object with ET_EntityOffset. For a conveyor, for example, select an entity ID within the range of 300...399.
The cartesian pose (position and orientation) corresponds to the orientation convention ZYX. If the orientation convention is different, the event is not set.
The entity ID is set to 1 if a target is to be attached to a global pose. For this, you can use the enumeration element Global in the enumeration ET_SystemEntity in the SchneiderElectricRobotics Toolbox library.
The event is written to the internal events buffer and to the OPC UA structure by the method Update.
Input |
Data type |
Description |
---|---|---|
i_udiTargetId |
UDINT |
ID of the target to be created on the entity. The ID must be unique. |
i_udiEntityId |
UDINT |
ID of the entity on which the target is to be created. |
i_lrReferencePosition |
LREAL |
The reference position on the entity where the target is to be created.
NOTE: This input is only needed when i_udiParentId is a conveyor.
|
i_stCartesianPose |
The cartesian pose of the target. |
|
i_etColorId |
The color configured for the target. The default value is GPL.Gc_etDefaultTargetColor. |
Output |
Data type |
Description |
---|---|---|
q_xError |
BOOL |
Indicates TRUE if an error has been detected. For details, refer to q_etResult and q_sResultMsg. |
q_etResult |
Provides diagnostic and status information as a numeric value. |
|
q_sResultMsg |
STRING [80] |
Provides additional diagnostic and status information as a text message. |
q_xError |
q_etResult |
Description |
---|---|---|
FALSE |
Ok |
The event was set. |
TRUE |
TargetIdInvalid |
The event was not set. |
TRUE |
TargetTypeInvalid |
The event was not set. |
TRUE |
EntityIdInvalid |
The event was not set. |
TRUE |
OrientationConventionInvalid |
The event was not set. |
TRUE |
ColorIdInvalid |
The event was not set. |
FALSE |
BufferFull |
The event was set. |
FALSE |
ReferencePositionIgnored |
The event was set. |
FALSE |
EntityInvalid |
The event was set. |