Basics of PLC Programming Chapter 5 75
is the assigned control number. Control elements in
control le 6 are numbered beginning with R6:0 and
running through R6:999. The addresses for the three
words in control element R6:0 are:
through the input module. Its operation can be summa-
rized as follows.
• For the switch that is closed, the processor detects a
voltage at the input terminal and records that infor-
mation by storing a binary 1 in its bit location.
• For the switch that is open, the processor detects no
voltage at the input terminal and records that infor-
mation by storing a binary 0 in its bit location.
• Each connected input has a bit in the input image
table le that corresponds exactly to the terminal to
which the input is connected.
• The input image table le is changed to re ect the
current status of the switch during the I/O scan
phase of operation.
• If the input is on (switch closed), its corresponding
bit in the table is set to 1.
• If the input is off (switch open), the corresponding
bit is cleared, or reset to 0.
• The processor continually reads the current input
status and updates the input image table le.
The output image table le is that part of the program
memory allocated to storing the actual on/off status of
connected discrete outputs. Figure 5-5 shows a typical
Control word: R6:0
Length: R6:0.LEN
Position: R6:0.POS
There are numerous control bits in the control word,
and their function depends on the instruction in
which the control element is used.
• The integer le stores integer data values, with a
range from 232,768 through 32,767. Stored values
are displayed in decimal form. The integer element
is a single-word (16-bit) element. As many as 1000
integer elements, addressed from N7:000 through
N7:999, can be stored.
- The address N7:100 addresses word 100 of the
integer le.
- Bit addressing is decimal, from 0 through 15.
For example, bit 12 in word 15 is addressed
N7:015/12.
• The oating-point le element can store val-
ues in the range from 61.1754944e-38 to
63.4028237e138. The oating-point element is a
two-word (32-bit) element. As many as 1000 ele-
ments, addressed from F8:000 through F8:999, can
be stored. Individual words or bits cannot be ad-
dressed in the oating-point le.
• Data les 9 through 999 may be assigned to dif-
ferent data types, as required. When assigned to a
certain type, a le is then reserved for that type and
cannot be used for any other type. Additional input,
output, or status les cannot be created.
The bit le, integer le, or oating-point le can be
used to store status or data. Which of these you use de-
pends on the intended use of the data. If you are deal-
ing with status rather than data, the bit le is preferable.
If you are using very large or very small numbers and
require a decimal point, the oating-point le is prefer-
able. The oating-point data type may have a restriction,
however, because it may not interface well with external
devices or with internal instructions such as counters and
timers, which use only 16-bit words. In such a situation, it
may be necessary to use the integer le type.
The input image table le is that part of the program
memory allocated to storing the on/off status of con-
nected discrete inputs. Figure5-4 shows the connection
of an open and closed switch to the input image table le
Figure 5-4 Connection of an open and closed switch to the
input image table fi le through the input module.
Input image
Word corresponding
to input module
ON
(closed)
(open)
Input module
OFF
L1
1
0
Data table
files
pet10882_ch05_071-094.indd 75pet10882_ch05_071-094.indd 75 7/23/10 9:14 PM7/23/10 9:14 PM