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:
i_stData.etShape: If no valid value is provided, the field is automatically set to a default value of ET_GeometricShape.Cube.
i_stData.lrLength: Can be left to a zero value.
i_stData.lrWidth: Can be left to a zero value.
i_stData.lrHeight: Can be left to a zero value.
i_stData.lrMass: Can be left to a zero value.
i_stData.stCenterOfMass: Can be left to a null 3D vector.
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 |
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. |
q_etDiag |
q_etDiagExt |
Enumeration value of q_etDiagExt |
Description |
---|---|---|---|
Ok |
Ok |
0 |
Ok |
Ok |
GeometricShapeInvalid |
139 |
A geometric shape value is invalid. |
Ok |
TargetTypeReconfigured |
252 |
The selected target type is already added and is reconfigured. |
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. |
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. |
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. |
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. |
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. |
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. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Success |
Status message: A target type has been successfully added to the list.
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. |
Enumeration name: |
TargetTypeReconfigured |
Enumeration value: |
252 |
Description: |
The selected target type is already added and is reconfigured. |
Status message: Adding and reconfiguring of the selected target type was successful.
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. |