Arc Tangent (ATAN)
The ATAN instruction computes the arc tangent of the Source value and stores the result in
the Destination (in radians). The ATAN operator/function computes the arc tangent of the
Source and returns the floating point result. The resulting value in the Destination is
greater than or equal to -pi/2 and less than or equal to pi/2 (where pi = 3.141593).
TIP:
In Logix Designer version 36, the mnemonic for this instruction changed
from ATN to ATAN.
Available Languages
Ladder Diagram

Function Block Diagram
Function Block Diagram supports these elements:
FBD Block

FBD Function

Structured Text
This instruction is not available in structured text.
TIP:
Use ATAN as an operator in an expression to compute the same result. Refer to
Structured Text Syntax for more information on the syntax of
expressions and assignments within structured text.
Operands
IMPORTANT:
Unexpected operation may occur if:
- Output tag operands are overwritten.
- Members of a structure operand are overwritten.
- Except when specified, structure operands are shared by multiple instructions.
There are data conversion rules for mixing numeric data types within an instruction. See
Data Conversions.
Ladder Diagram
Operand | Data Type | Format | Description |
Source | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | Immediate tag | Value to convert to arc tangent. |
Destination | REAL LREAL | tag | Tag to store the result of the instruction. |
Function Block Diagram
Function Block
Operand | Type | Format | Description |
ATAN tag | FBD_MATH_ADVANCED | tag | ATAN structure |
FBD_MATH_ADVANCED Structure
Input Member | Data Type | Description |
EnableIn | BOOL | Enable input. If false, the instruction does not execute and outputs are not
updated. Default is true. |
Source | REAL | Input to the trigonometric instruction. |
Output Member | Data Type | Description |
EnableOut | BOOL | Indicates if the instruction executed without fault when it was enabled. |
Dest | REAL | Result of the instruction. |
FBD Function
Operand | Data Type | Description |
Source | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | Value to convert to arc tangent. |
Output Operand (Right Pin) | Data Type | Description |
Dest | REAL LREAL | Result of the function. |
See FBD Functions.
Operator Aspects
The ATAN operator can be used in various RLL expressions. Similarly, the ATAN function is
invoked in Structured Text statements. ATAN returns a floating point result containing the
arc tangent of the Source. Depending on the context this value may then be type converted if
appropriate.
Affects Math Status Flags
Conditional
See Math Status Flags.
Major/Minor Faults
None specific to this instruction. See Index through arrays
for array-indexing faults.
Execution
Ladder Diagram
Condition/State | Action Taken |
Prescan | N/A |
Rung-condition-in is false | Set Rung-condition-out to Rung-condition-in. |
Rung-condition-in is true | Set Rung-condition-out to Rung-condition-in. Dest = arc tangent value of the Source. |
Postscan | N/A |
Function Block Diagram
FBD Block
Condition/State | Action Taken |
Prescan | N/A |
EnableIn is false | Set EnableOut to EnableIn. |
EnableIn is true | Dest = arc tangent value of the Source. If overflow occurs Clear EnableOut to false. else Set EnableOut to true. |
Instruction first run | N/A |
Instruction first scan | N/A |
Postscan | N/A |
FBD Function
Condition/State | Action Taken |
Prescan | N/A |
Normal Scan | Dest = arc tangent value of the Source. |
Instruction first run | N/A |
Instruction first scan | N/A |
Postscan | N/A |
Example
Ladder Diagram

Function Block Diagram
FBD Block

FBD Function

Structured Text
REAL_dest := ATAN(REAL_src);
Provide Feedback