27
Work Bits and Words When
some bits and words in certain data areas are not being used for their
in
-
tended
purpose, they can be used in programming as required to control other
bits. W
ords and bits available for use in this fashion are called work words and
work
bits. Most, but not all, unused bits can be used as work bits. Those that can
be
used are described area-by-area in the remainder of this section. Actual ap
-
plication
of
work bits and work words is described in
Section
4 Writing and Input
-
ting the Program.
Flags and Control Bits Some
data areas contain flags and/or control bits. Flags are bits that are auto
-
matically turned ON and OFF to indicate particular operation status. Although
some
flags can be turned ON and OFF by the user
, most flags are
read only; they
cannot be controlled directly.
Control
bits are bits turned ON and OFF by the user to control
specific aspects of
operation.
Any bit given a name using the word bit rather than the word flag is a
control bit, e.g., Restart bits are control bits.
3-2 Data Area Structure
When
designating a data area, the acronym for the area is always required for
any
but the IR and SR areas. Although the acronyms for the
IR and SR areas are
often
given for clarity in text explanations, they are not required, and not entered,
when
programming.
Any data area designation without an acronym is assumed
to
be in either the IR or SR area. Because IR and SR addresses run consecu
-
tively, the word or bit addresses are sufficient to differentiate these two areas.
An
actual data location within any data area but the TC area is designated by its
address.
The address
designates the bit or word within the area where the de
-
sired
data is located.
The TC area consists of TC numbers, each of which is
used
for
a specific timer or counter defined in the program. Refer to
3-8 TC Area
for
more
details on TC numbers
and to
5-14 T
imer and Counter Instructions
for in
-
formation on their application.
The
rest of the data areas (i.e., the IR, SR, HR,
DM, AR, and LR areas) consist of
words,
each of which consists of 16 bits numbered 00 through 15 from right to
left.
IR words 000
and 001 are shown below with bit numbers. Here, the content
of
each word is shown as all zeros. Bit 00 is
called the rightmost bit; bit 15, the
leftmost bit.
The
term least significant bit is often used for rightmost bit; the term most signifi
-
cant bit, for leftmost bit. These terms are not used in this manual because a
single
data word is often split into two or more parts, with each part used for dif
-
ferent
parameters or
operands. When this is done, the rightmost bits of a word
may actually become the most significant bits, i.e., the leftmost bits in another
word,when combined with other bits to form a new word.
Bit number
IR word 000 0000000000000000
IR word 001 0000000000000000
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
The
DM area is accessible by word only; you cannot designate an individual bit
within
a DM word. Data in the IR, SR, HR, AR, and LR areas is accessible either
by
word or by bit, depending on the instruction in which the data is being used.
To
designate one of these areas by word, all that is necessary is the acronym (if
required)
and the two-,
three-, or four-digit word address. T
o designate an area
by
bit, the word address is combined with the bit number as a single four- or five-
digit
address. The following table show examples of this. The two rightmost dig
-
its
of a bit designation must indicate a bit between 00 and 15, i.e., the rightmost
digit must be 5 or less the next digit to the left, either 0 or 1.
Data Area Structure Section 3-2