Radian (RAD)
When enabled, the RAD instruction converts the Source (in degrees) to radians and stores the result in the Destination.
The RAD instruction uses this algorithm:
Deg2RadConvFactor=pi/180= 0.017453292
Destination = Source * Deg2RadConvFactor
Available Languages
Ladder Diagram
Operands
IMPORTANT:
Unexpected operation may occur if:
- Output tag operands are overwritten
- Members of a structure operand are overwritten
- Except when specified, structure operands are shared by multiple instructions.
There are data conversion rules for mixing numeric data types within an instruction. See Data conversions.
Ladder Diagram
Operand | Data Type | Format | Description |
---|---|---|---|
Source | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | Immediate tag | Value to convert to radians |
Destination | SINT INT DINT LINT USINT UINT UDINT ULINT REAL LREAL | tag | Tag to store the result |
Affects Math Status Flags
Conditional. See Math status flags.
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 = radian value of the Source. |
Postscan | N/A |
Example
Ladder Diagram
Provide Feedback