Technical data
Example 1
Before program block PB 12 is called, all the flags (FY 0 to FY 255) must
be saved in data block DX 37 from address 100 onwards and then written back
to the flag area.
Saving: :CX DX 37 Call the data block
:L KY 0,255 Flag area FY0 to FY255
:L KB 100 Number of the 1st data word in the
: destination DB
:JU OB 190 Save flags
Block change: :JU PB 12
Writing back: : (Data block already called)
:L KB 100 Number of the 1st data word in
: the source DB
:L KY 0,255 Flag area FY0 to FY255
:JU OB 191 Write back flags
Example 2
Flags used by the cyclic user program must not be used by a time or
process-driven user program. Each program processing level must have a
particular section of the flag area assigned to it.
e.g.: Cyclic user program: FY0 ... . ... FY99
Time-driven user program: FY100 ... . ... FY199
Process interrupt-driven user program: FY200 ... . ... FY255
If, however, the cyclic user program is already using all 256 flag bytes
and the time-driven user program also requires all 256 flag bytes, the
flags must be swapped over when the processing level is changed and the old
flags stored until the program returns to the original processing level.
The quickest way to save and load these flags is with the special function
blocks OB 190 and OB 191. Fig. 6-9 illustrates how a flag area FYx to FYy
used by both OB 1 and OB 13 (100 ms time interrupt) can be buffered in a
data block DBx.
Continued on the next page
OB 191/OB 193: Transferring Data Fields to a Flag Area
CPU 928B Programming Guide
6 - 74 C79000-B8576-C898-01