2 Instruction Descriptions
2-172
NJ-series Instructions Reference Manual (W502)
RadToDeg and DegToRad
* If you omit an input parameter, the default value is not applied. A building error will occur.
z RadToDeg
The RadToDeg instruction converts the data to convert In from radians (rad) to degrees (°). The fol-
lowing conversion is used.
Out=In*180/Ï€
z DegToRad
The DegToRad instruction converts the data to convert In from degrees (°) to radians (rad). The fol-
lowing conversion is used.
Out=In*Ï€/180
RadToDeg: Converts a real number from radians (rad) to degrees (°).
DegToRad: Converts a real number from degrees (°) to radians (rad).
Instruction Name FB/FUN Graphic expression ST expression
RadToDeg Radians to Degrees FUN Out:=RadToDeg(In);
DegToRad Degrees to Radians FUN Out:=DegToRad(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Data to
convert
Input Data to convert Depends on data type. • RadToDeg: Radians
• DegToRad: Degrees
*
Out Conver-
sion result
Output Conversion result Depends on data type. • RadToDeg: Degrees
• DegToRad: Radians
---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK OK
Out OK OK
Function
(@)RadToDeg
EN ENO
In Out
(@)DegToRad
EN ENO
In Out