FC_DistanceBoxAndSphere

 

FC_DistanceBoxAndSphere - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the distance between a cuboid and a sphere.

Description

This calculates the distance between the cuboid i_stBox and the sphere i_stSphere.

Interface

Input

Data type

Description

i_stBox

ST_Box

Cuboid

i_stSphere

ST_Sphere

Sphere

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an 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_lrDistance

LREAL

Calculated distance between i_stBox and i_stSphere.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionBox

34

The definition of Box is not correct.

InputParameterInvalid

RadiusRangeSphere

22

The radius of the sphere is outside the valid range.

DefinitionBox

Enumeration name:

DefinitionBox

Enumeration value:

34

Description:

The definition of Box is not correct.

Issue

Cause

Solution

-

At the inputs i_stBox.stSpanPoint1 and i_stBox.stBasePoint, the same point has been transferred.

The distance between i_stBox.stSpanPoint1 and i_stBox.stBasePoint must be at least Gc_lrZeroTolerance.

-

At the inputs i_stBox.stSpanPoint2 and i_stBox.stBasePoint, the same point has been transferred.

The distance between i_stBox.stSpanPoint2 and i_stBox.stBasePoint must be at least Gc_lrZeroTolerance.

-

At the inputs i_stBox.stSpanPoint3 and i_stBox.stBasePoint, the same point has been transferred.

The distance between i_stBox.stSpanPoint3 and i_stBox.stBasePoint must be at least Gc_lrZeroTolerance.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The distance has been calculated successfully.

RadiusRangeSphere

Enumeration name:

RadiusRangeSphere

Enumeration value:

22

Description:

The radius of the sphere is outside the valid range.

Issue

Cause

Solution

-

At the input i_stSphere.lrRadius, a number <= 0 has been applied.

The radius of the sphere must be greater than 0.