Skip to main content

ATAN

Calculates the arc tangent of Value and stores the result in Angle.

Ladder Representation

ATAN block

Block Structure

Variable TypeNameData TypeDescription
VAR_INPUTENBOOLBlock enabling.
VAR_INPUTValueREALTangent value.
VAR_OUTPUTDoneBOOLEnd of operation.
VAR_OUTPUTAngleREALAngle whose tangent equals Value, in radians.

Operation

When EN is TRUE, the block writes the arc tangent of Value to Angle.

If the operation completes without errors, Done is set. If an operation error occurs, Done remains FALSE and Angle keeps its previous value.

When EN is FALSE, Angle remains unchanged and Done remains FALSE.

Execution Flowchart

ATAN execution flowchart

Examples

ATAN ladder example 1

This example calculates the angle, in radians, whose tangent is VALUE, and stores the final result in ANGLE. For positive values, the angle is always in the first quadrant. The block completes successfully and activates Done.

ATAN ladder example 2

This example calculates the angle, in radians, whose tangent is VALUE, and stores the final result in ANGLE. For negative values, the angle is always in the fourth quadrant. The block completes successfully and activates Done.