Tangent (TAN)
The TAN instruction takes the tangent of the Source value (in radians) and stores the result in the Destination.
The TAN operator or function computes the tangent of Source and returns the floating point result.
Available Languages
Ladder Diagram
_v1.png/_jcr_content/renditions/original)
Structured Text
This instruction is not available in structured text. However, in the Structured Text
Editor you can use TAN 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.
FactoryTalk Design Studio
DSL - Ladder DiagramOperands
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 tangent. |
Destination | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | tag | Tag to store result of the instruction. |
Operator Aspects
The TAN operator can be used in various expressions. Both applications of TAN return a floating point result containing the 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 = tangent value of the Source. |
Postscan | N/A |
Example
Ladder Diagram

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