2-173
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Math Instructions
2
RadToDeg and DegToRad
The following example for the DegToRad instruction is for when In is REAL#45. The value of the
REAL variable abc will be REAL#0.785398.
Use the CheckReal instruction (page 2-209) to see if Out is positive infinity, negative infinity, or nonnu-
meric data.
• If the absolute value of the conversion result exceeds the maximum value of the data type of Out, the
value of Out will be positive or negative infinity.
• If the absolute value of the conversion result is lower than the minimum value of the data type of Out,
the value of Out will be 0.
• Make sure that the data type of Out is equal to or larger than the data type of In.
• If the value of In is positive infinity, negative infinity, or nonnumeric data, the value of Out is as shown
below.
• If you pass an integer parameter to In, the data type is converted as follows:
Additional Information
Precautions for Correct Use
Value of In Value of Out
+∞ +∞
−∞ −∞
Nonnumeric data Nonnumeric data
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:=DegToRad(REAL#45);
LD ST
abc
REAL#45
DegToRad
EN ENO
In