Chapter 16
Math Conversion Instructions (DEG, RAD, TOD, FRD, TRN, TRUNC)
Convert to BCD (TOD)
Input Parameter
Data Type
EnableIn
BOOL
Source
DINT
Output Parameter
Data Type
EnableOut
BOOL
Dest
DINT
564
The TOD instruction converts a decimal value
value and stores the result in the Destination.
Operands:
Relay Ladder
Operand
Source
Destination
Function Block
Operand
TOD tag
FBD_CONVERT Structure
Description
Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
Input to the conversion instruction.
Valid = any integer
Description
The instruction produced a valid result.
Result of the conversion instruction. Arithmetic status flags are set for this output.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Type
Format
SINT
Immediate
INT
Tag
DINT
A SINT or INT tag converts to a DINT value by zero-fill.
SINT
Tag
INT
DINT
Type
FBD_CONVERT
(0 ≤ Source ≤ 99,999,999)
Description
Value to convert to decimal
Stores the result
Format
Description
Structure
TOD structure
to a BCD