FC_DistanceCylinderAndSphere

 

FC_DistanceCylinderAndSphere - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the distance between a cylinder and a sphere.

Description

This calculates the distance between the cylinder i_stCylinder and the sphere i_stSphere.

Interface

Input

Data type

Description

i_stCylinder

ST_Cylinder

Cylinder

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

This calculates the distance between i_stCylinder and i_stSphere.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionCylinder

42

The definition of Cylinder is not correct.

InputParameterInvalid

RadiusRangeSphere

22

The radius of the sphere is outside the valid range.

DefinitionCylinder

Enumeration name:

DefinitionCylinder

Enumeration value:

42

Description:

The definition of Cylinder is not correct.

Issue

Cause

Solution

-

At the input i_stCylinder.lrRadius, a value <= 0 has been transferred.

The radius of the cylinder must be greater than zero.

-

At the inputs i_stCylinder.stAxisStart and i_stCylinder.stAxisEnd, the same point has been transferred.

The distance between i_stCylinder.stAxisStart and i_stCylinder.stAxisEnd 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.