FB_EntitiesHandler - AddTargetType (Method)

Overview

Type:

Method

Available as of:

V1.4.1.0

This chapter provides information on:

oTask

oDescription

oInterface

oDiagnostic Messages

Task

Add a new target type to the function block.

Description

The method AddTargetType is used to add a new target type to the function block.

The data configured with this method is stored inside the function block and can be later used to retrieve physical information on a specific target type (for example, length, height, mass, and so on).

The following parameters are considered optional:

oi_stData.etShape: If no valid value is provided, the field is automatically set to a default value of ET_GeometricShape.Cube.

oi_stData.lrLength: Can be left to a zero value.

oi_stData.lrWidth: Can be left to a zero value.

oi_stData.lrHeight: Can be left to a zero value.

oi_stData.lrMass: Can be left to a zero value.

oi_stData.stCenterOfMass: Can be left to a null 3D vector.

Interface

Input

Data type

Description

i_stData

ST_TargetTypeData

A data structure containing a description of a target type in terms of physical properties.

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic. A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

q_sMsg

STRING[80]

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

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value of q_etDiagExt

Description

Ok

Ok

0

Ok

Ok

GeometricShapeInvalid

139

A geometric shape value is invalid.

ExecutionAborted

MaxNumberOfTargetTypesExceeded

140

The maximum number of configurable target types is reached.

InputParameterInvalid

HeightRange

143

A provided height is not within its admissible range.

InputParameterInvalid

LengthRange

141

A provided length is not within its admissible range.

InputParameterInvalid

MassRange

144

A provided mass is not within its admissible range.

InputParameterInvalid

TargetTypeInvalid

134

A provided target type is invalid.

InputParameterInvalid

WidthRange

142

A provided width is not within its admissible range.

GeometricShapeInvalid

Enumeration name:

GeometricShapeInvalid

Enumeration value:

139

Description:

A geometric shape value is invalid.

Issue

Cause

Solution

A target type has been successfully added to the list but the library has assigned the default value ET_GeometricShape.Cube to the target type.

i_stData.etShape contains an invalid value.

Ensure to provide a value in the range ET_GeometricShape.Cube...ET_GeometricShape.TriangularPrism.

HeightRange

Enumeration name:

HeightRange

Enumeration value:

143

Description:

A provided height is not within its admissible range.

Issue

Cause

Solution

A target type has not been successfully added to the list.

i_stData.lrHeight  contains a negative value.

Ensure that i_stData.lrHeight is either null or positive.

LengthRange

Enumeration name:

LengthRange

Enumeration value:

141

Description:

A provided length is not within its admissible range.

Issue

Cause

Solution

A target type has not been successfully added to the list.

i_stData.lrLength contains a negative value.

Ensure that i_stData.lrLength is either null or positive.

MassRange

Enumeration name:

MassRange

Enumeration value:

144

Description:

A provided mass is not within its admissible range.

Issue

Cause

Solution

A target type has not been successfully added to the list.

i_stData.lrMass contains a negative value.

Ensure that i_stData.lrMass is either null or positive.

MaxNumberOfTargetTypesExceeded

Enumeration name:

MaxNumberOfTargetTypesExceeded

Enumeration value:

140

Description:

The maximum number of configurable target types is reached.

Issue

Cause

Solution

A target type has not been successfully added to the list.

Gc_uiMaxNumberOfTargetTypes target types have already been configured.

Ensure not to configure more than Gc_uiMaxNumberOfTargetTypes target types.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

Status message: A target type has been successfully added to the list.

TargetTypeInvalid

Enumeration name:

TargetTypeInvalid

Enumeration value:

134

Description:

A provided target type is invalid.

Issue

Cause

Solution

A target type has not been successfully added to the list.

i_stData.etType contains an invalid value.

Ensure that i_stData.etType contains a value in the range ET_TargetType.Type1... ET_TargetType.Type20.

WidthRange

Enumeration name:

WidthRange

Enumeration value:

142

Description:

A provided width is not within its admissible range.

Issue

Cause

Solution

A target type has not been successfully added to the lis.t

i_stData.lrWidth contains a negative value.

Ensure that i_stData.lrWidthis either null or positive.