Description
You can use the "Form tangent value" instruction to calculate the tangent of an angle. The size of the angle is specified in the radian measure at input IN. The result of the instruction is provided at output OUT and can be queried there.
Enable output ENO has the signal state "0" if one of the following conditions applies:
-
Enable input EN has the signal state "0".
-
The value at input IN is not a valid floating-point number.
Parameters
The following table shows the parameters of the instruction "Form tangent value":
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|
|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
||||
|
EN |
Input |
BOOL |
I, Q, M, D, L or constant |
I, Q, M, D, L, T, C or constant |
Enable input |
|
ENO |
Output |
BOOL |
I, Q, M, D, L |
I, Q, M, D, L |
Enable output |
|
IN |
Input |
Floating-point numbers |
I, Q, M, D, L, P or constant |
I, Q, M, D, L, P or constant |
Size of angle in the radian measure |
|
OUT |
Output |
Floating-point numbers |
I, Q, M, D, L, P |
I, Q, M, D, L, P |
Tangent of the specified angle |
You can select the data type of the instruction from the "<???>" drop-down list of the instruction box.
For additional information on valid data types, refer to "See also".
Example
The following example shows how the instruction works:
The following table shows how the instruction works using specific operand values:
|
Parameters |
Operand |
Value |
|---|---|---|
|
IN |
Tag_Value |
+3.141593 (π) |
|
OUT |
Tag_Result |
0 |
If the operand "TagIn" has the signal state "1", the "Form tangent value" instruction is executed. The instruction calculates the tangent of the angle specified at input "Tag_Value" and stores the result at output "Tag_Result". If no errors occur during the execution of the instruction, the output "TagOut" is set.