FC_DistanceTwoSpheres

 

FC_DistanceTwoSpheres - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the distance between two spheres in the 3-dimensional space.

Description

Calculates the distance between the spheres i_stSphere1 and i_stSphere2

Interface

Input

Data type

Description

i_stSphere1

ST_Sphere

Sphere 1

i_stSphere2

ST_Sphere

Sphere 2

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 the spheres i_stSphere1 and i_stSphere2

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

RadiusRangeSphere1

23

The radius of sphere 1 is outside the valid range.

InputParameterInvalid

RadiusRangeSphere2

24

The radius of sphere 2 is outside the valid range.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The distance has been calculated successfully.

RadiusRangeSphere1

Enumeration name:

RadiusRangeSphere1

Enumeration value:

23

Description:

The radius of sphere 1 is outside the valid range.

Issue

Cause

Solution

-

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

The radius of the sphere must be greater than 0.

RadiusRangeSphere2

Enumeration name:

RadiusRangeSphere2

Enumeration value:

24

Description:

The radius of sphere 2 is outside the valid range.

Issue

Cause

Solution

-

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

The radius of the sphere must be greater than 0.