Navigation:  Equipments (Devices) > SCA06 > Ladder > Math > Math Trigonometry >

ATAN

Previous pageReturn to chapter overviewNext page

Block that calculates the arctangent of Value, storing the result in Angle.

 

Ladder Representation

 

ATAN_block

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

Value

REAL

Value of tangent

VAR_OUTPUT

Done

BOOL

End of operation

Angle

REAL

Value of the angle whose tangent is equal to Value (in radians)

 

Operation

 

When this block has a TRUE value in EN, it sends to the Angle output the arctangent of Value. If no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in FALSE status, while Angle remains with its value unchanged.

 

When EN has FALSE value, Angle remains unchanged and Done remains in FALSE.

 

Block Flowchart

 

ATAN_flowchart

 

Example in Ladder

 

ATAN_example01

 

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the final result in ANGLE. The arc, for positive values, is always in the first quadrant. The block ends with success and Done output is activated.

 

ATAN_example02

 

The above example calculates the arc, in radians, whose tangent is the VALUE variable, storing the final result in ANGLE. The arc, for negative values, is always in the fourth quadrant. The block ends with success and Done output is activated.

 

Example in ST

 

 The example below displays the instructions for applying the example above in the ST language.

 

 

VAR

   VALUE : REAL := -1.0;

   ANGLE : REAL;

END_VAR

 

ANGLE := FB_ATAN(EN:=DI1, Value:=VALUE, Done=>DO1);