2 Instruction Descriptions
2-176
NJ-series Instructions Reference Manual (W502)
The following example for the COS instruction is for when In is REAL#3.141592. The value of vari-
able abc will be REAL#−1.0.
• Use the RadToDeg and DegToRad instructions (page 2-172) to convert between degrees and radi-
ans.
• If In for the TAN instruction is nπ/2, when n is an integer, then the value of Out will be positive or neg-
ative infinity. Use the CheckReal instruction (page 2-209) to see if the value of Out is positive infinity
or negative infinity.
• If the value of In is positive infinity, negative infinity, or nonnumeric data, the value of Out is nonnu-
meric 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:=COS(REAL#3.141592);
LD ST
abc
REAL#3.141592
COS
EN ENO
In