Publication 1766-RM001A-EN-P - October 2008
250
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).
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 1400
5.9198 µs
0.3916 µ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 92.
Parameter
Data Files
Function Files
CS0 - Com
m
s
IOS - I/O
DLS - 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
HSC
PTOX, PW
MX
STI
EII
BH
I
MMI
LCD
Immedia
te
Dir
e
c
t
In
dire
ct
Bit
Wo
rd
Long W
o
rd
E
lement
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, MG, PD, RTC, HSC, PTOX,
PWMX, STI, EII, BHI, MMI, CS, IOS, and DLS files.
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive