Arc Cosine (ACOS)

This table lists the controllers and applications that support this instruction.
Architecture
Standard applications
Safety applications
CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, and GuardLogix 5570 controllers
Yes
No
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers
Yes
Yes
When enabled, the ACOS instruction takes the arc cosine of the Source value and stores the result in the Destination (in radians).
TIP: In Logix Designer version 36, the mnemonic for this instruction changed from ACS to ACOS.
Available Languages
These are the available languages for Arc Cosine (ACOS).
Ladder Diagram
Function Block Diagram
Function Block Diagram supports these elements:
FBD Block
FBD Function
TIP: FBD Function is applicable to CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
Structured Text
This instruction is not available in structured text.
TIP:
Use ACOS 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 structured operand are overwritten.
  • Except when specified, structure operands are shared by multiple instructions.
Ladder Diagram
Operand
Data Type
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370, and
GuardLogix
5570 controllers
Data Type
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers
Format
Description
Source
SINT
INT
DINT
REAL
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
Immediate
tag
Value to convert to arc cosine.
Destination
SINT
INT
DINT
REAL
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
tag
Tag to store result of the instruction.
Function Block Diagram
FBD Block
Operand
Type
Format
Description
ACOS
FBD_MATH_ADVANCED
tag
ACS 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
TIP: FBD Function is applicable to CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers only.
Operand
Data Type
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers
Description
Source
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
Value to convert to arc cosine.
Output Operand (Right Pin)
Data Type
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers
Description
Dest
REAL
LREAL
Result of the function.
Operator Aspects
The ACOS operator can be used in various RLL expressions. Similarly, the ACOS function is invoked in Structured Text statements. ACOS returns a floating point result containing the arc cosine of the Source. Depending on the context this value may then be type converted if appropriate.
Description
The ACOS instruction takes the arc cosine of the Source value and stores the result in the Destination (in radians). The ACOS operator/function computes the arc cosine of the Source and returns the floating point result. The Source must be greater than or equal to -1 and less than or equal to 1. The resulting value in the Destination is greater than or equal to 0 or less than or equal to pi (where pi = 3.141593). If Source is smaller than -1 or greater than 1 then Destination is set to NAN.
Affects Math Status Flags
Controllers
Affects Math Status Flag
CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers
Conditional, see Math Status Flags.
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370, and
GuardLogix
5570 controllers
Yes
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 cosine 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 cosine value of the Source.
If overflow occurs
Clear EnableOut to false.
else
Set EnableOut to true.
Instruction first scan
N/A
Instruction first run
N/A
Postscan
N/A
FBD Function
Condition/State
Action Taken
Prescan
N/A
Normal Scan
Dest = arc cosine 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 := ACOS(REAL_src);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.