AttachTargetToEntity (Method)

Overview

Type:

Method

Available as of:

V1.1.0.0

Task

Attaching a target to an entity.

Description

The method AttachTargetToEntity attaches a target to the specified entity.

Ensure that the following prerequisites are fulfilled:
  • 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.

  • 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.

Interface

Input

Data type

Description

i_udiTargetId

UDINT

ID of the target to be attached to the entity. The ID must be unique.

i_udiEntityId

UDINT

ID of the entity to which the target is to be attached.

i_lrReferencePosition

LREAL

The reference position on the entity where the target is to be attached to.

NOTE: This input is only needed when i_udiParentId is a conveyor.

i_stCartesianPose

GEM.ST_CartesianPose

The cartesian pose of the target.

i_etColorId

ET_EmulationColors

The color configured for the target.

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

ET_Result

Provides diagnostic and status information as a numeric value.
If q_xError = FALSE, q_etResult provides status information.
If q_xError = TRUE, q_etResult provides diagnostic/error information.

q_sResultMsg

STRING [80]

Provides additional diagnostic and status information as a text message.

Diagnostic Messages

q_xError

q_etResult

Description

FALSE

Ok

The event was set.

TRUE

TargetIdInvalid

The event was not set.
Cause: The input value of i_udiTargetId is invalid.
Solution: Provide a valid target ID. The value must be greater than 0. The target ID is to be configured in the OPC UA structure by using the variable udiUnivocalId.

TRUE

EntityIdInvalid

The event was not set.
Cause: The input value of i_udiEntityId is invalid.
Solution: Provide a valid entity ID. The value must be greater than 0. Configure the target ID with the variable udiUnivocalId.

TRUE

OrientationConventionInvalid

The event was not set.
Cause: The input value of i_stCartesianPose.etOrientationConvention is invalid.
Solution: Provide a valid value. Ensure that the orientation convention is ZYX, which corresponds to a right-hand coordinate system.
For more information, refer to GEM.ET_OrientationConventionGEM.ET_OrientationConvention.

TRUE

ColorIdInvalid

The event was not set.
Cause: The input value of i_etColorId is invalid.
Solution: Provide a valid value. Select a value defined in ET_EmulationColors.

FALSE

BufferFull

The event was set.
Cause: The internal events buffer is full and starts to overwrite prior events.
Solution: Enlarge the internal events buffer by using the global parameter Gc_udiInternalEventsBufferSize and/or enlarge the event OPC UA structure by using the global parameter Gc_udiMaxNumberOfEventData.

FALSE

ReferencePositionIgnored

The event was set.
Cause: The reference position lrReferencePosition was ignored because the entity is not a conveyor.
Solution: Set the value of lrReferencePosition to 0.