ATAN
Calculates the arc tangent of Value and stores the result in Angle.
Ladder Representation
Block Structure
| Variable Type | Name | Data Type | Description |
|---|---|---|---|
| VAR_INPUT | EN | BOOL | Block enabling. |
| VAR_INPUT | Value | REAL | Tangent value. |
| VAR_OUTPUT | Done | BOOL | End of operation. |
| VAR_OUTPUT | Angle | REAL | Angle 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

Examples
- Ladder Example
- Structured Text Example
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.
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.
The following Structured Text code applies the same logic shown in the Ladder example.
VAR
VALUE : REAL := -1.0;
ANGLE : REAL;
END_VAR
ANGLE := FB_ATAN(EN:=DI1, Value:=VALUE, Done=>DO1);