FB_CollisionEntityAddCollisionGroup (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

This chapter provides information on:

Task

Adds a collision group.

Description

Adding a collision group to the collision entity.

Interface

The function block implements the interface IF_CollisionEntity.

Access: PUBLIC

Return type: UDINT

Input

Data type

Description

i_ifCollisionGroup

IF_CollisionGroup

Collision group to add to the entity.

Output

Data type

Description

q_xError

BOOL

The output is set to TRUE if an error has been detected during the execution.

q_etResult

ET_Result

POU-specific output on the diagnostic; q_xError = FALSE -> Status message; q_xError = TRUE -> Diagnostic message.

q_sResultMsg

STRING(80)

Event-triggered message that gives additional information on the diagnostic state.

Return Value

The returned value is the index of the collision group added to the list. It can be used to refer to such group through the property raifCollisionGroups.

Diagnostic Messages

q_xError

q_etResult

Enumeration value

Description

FALSE

Ok

0

Success

TRUE

MaxNumberOfCollisionEntityGroupsReached

32

The maximum number of collision entity groups has been reached.

TRUE

InterfaceInvalid

11

The provided interface is invalid (null).

OK

Enumeration name:

Ok

Enumeration value:

0

Description:

Success

MaxNumberOfCollisionEntityGroupsReached

Enumeration name:

MaxNumberOfCollisionEntityGroupsReached

Enumeration value:

32

Description:

The maximum number of collision entity groups has been reached.

Issue

Cause

Solution

Could not add a collision group to the entity

The list of collision groups for this entity is already full, meaning that udiNumberOfCollisionGroups = Gc_udiMaxNumberOfCollisionEntityGroups

Make sure that udiNumberOfCollisionGroups < Gc_udiMaxNumberOfCollisionEntityGroups before calling this method.

InterfaceInvalid

Enumeration name:

InterfaceInvalid

Enumeration value:

11

Description:

The provided interface is invalid (null).

Issue

Cause

Solution

Could not add a collision group to the entity

i_ifCollisionGroup contains an invalid interface.

Make sure that i_ifCollisionGroup is not null.