2-179
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Math Instructions
2
ASIN, ACOS, and ATAN
The following example for the ACOS instruction is for when In is REAL#−1.0. The value of variable
abc will be REAL#3.141592.
Use the RadToDeg and DegToRad instructions (page 2-172) to convert between degrees and radians.
• If In is not between −1.0 and 1.0 for the ASIN or ACOS instruction, the value of Out is nonnumeric
data. That also applies when the value of In is negative infinity, positive infinity, or nonnumeric data.
• If the value of In is nonnumeric data for the ATAN instruction, the value of Out is nonnumeric data.
• If you pass an integer parameter to In, the data type is converted as follows:
Additional Information
Precautions for Correct Use
Data type of parameter that is
passed to In
Data type of In
USINT, UINT, SINT, or INT REAL
UDINT or DINT LREAL
ULINT or LINT A building error will occur.
abc:=ACOS(REAL#-1.0);
LD ST
abc
REAL#-1.0
ACOS
EN ENO
In