Publication 1763-RM001C-EN-P - October 2009
208
Conversion Instructions
TOD - Convert to Binary
Coded Decimal (BCD)
Instruction Type: output
The TOD instruction is used to convert the integer source value to BCD
and place the result in the destination.
Addressing Modes and File Types can be used as shown in the following
table:
TOD Instruction Destination Operand
The destination can be either a word address or math register.
The maximum values permissible once converted to BCD are:
•
9999 if the destination is a word address (allowing only a 4-digit
BCD value)
•
32768 if the destination is the math register (allowing a 5-digit BCD
value with the lower 4 digits stored in S:13 and the high order digit
in S:14).
If the destination is the math register, it must be directly addressed as S:13.
S:13 is the only status file element that can be used.
TOD
To BCD
Source
N7:0
0<
Dest
N7:1
0000h<
TOD
Execution Time for the TOD Instructions
Controller
When Rung Is:
True
False
MicroLogix 1100
29.31
μ
s
0.87
μ
s
TOD Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page 82.
Parameter
Data Files
Function Files
CS0 - Comms
IO
S -
I/O
DL
S
- Da
ta
L
o
g
Address
Mode
(1)
Address Level
O
I
S
B
T,
C
, R
N
F
L
MG,
PD
Ri
PLS
RTC
HS
C
PTO, P
W
M
STI
EII
BH
I
MMI
LCD
Imme
diate
Di
re
c
t
In
dir
e
ct
Bi
t
Wo
rd
Long
W
o
rd
E
lem
en
t
Source
•
•
•
•
•
•
•
•
•
Destination
•
•
•
•
•
•
•
•
•
•
(2)
(1) See Important note about indirect addressing.
(2) See TOD Instruction Destination Operand below.
IMPORTANT
You cannot use indirect addressing with: S, ST, MG, PD,
RTC, HSC, PTO, PWM, STI, EII, BHI, MMI, CS, IOS, and
DLS files.
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive