Block that calculates the arccosine of Value, storing the result in Angle.
Ladder Representation
![]()
Block Structure
Variable Type |
Name |
Data Type |
Description |
VAR_INPUT |
EN |
BOOL |
Block enabling |
Value |
REAL |
Value of cosine |
|
VAR_OUTPUT |
Done |
BOOL |
End of operation |
Angle |
REAL |
Value of the angle whose cosine is equal to Value (in radians) |
Operation
When this block has a TRUE value in EN, it sends to the Angle output the arccosine 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

Example in Ladder

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the final result in ANGLE. The block ends with success and Done output is activated.

The above example calculates the arc, in radians, whose cosine is the VALUE variable, storing the final result in ANGLE. The block generates a runtime error, since VALUE has value inferior to -1, and Done output is disabled.
Example in ST
The example below displays the instructions for applying the example above in the ST language.
VAR VALUE : REAL := 0.0; ANGLE : REAL; END_VAR
ANGLE := FB_ACOS(EN:=DI1, Value:=VALUE, Done=>DO1);
|
|---|