Technical data
Example of UALW
The following example tests whether a module can be addressed at a
certain peripheral address. If the module does not exist, ICRW prevents
a timeout and a program written for the situation is executed. The
example also tests whether a particular peripheral address has been
entered in DB 1. If the address does not exist in DB 1, ICRW prevents an
addressing error and a special program is executed.
FB 201
NAME:L
:JU FB 10
NAME:PERITEST Test whether a module can be addressed at
PADR : PB 128 peripheral adddress 128
MASK : KM 00000100 00000000
:JN =M001
:.. This program section is processed if the module
:.. cannot be addressed
:..
M001 :
:JU FB 10
NAME:PERITEST Test whether a module with peripheral
PADR : QB 4 address 4 is entered in DB 1
MASK : KM 00000010 00000000
:JN =M002
:.. This program section is processed,
:.. if the peripheral address
:.. is not entered
M002 :
:BE
FB 10
NAME:PERITEST
DECL :PADRI/Q/D/B/T/C: I BI/BY/W/D: BY
DECL :MASKI/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KM
:L RS 1 Load and save ICRW
:T RS 60
:LW =MASK Set QVZ or ADF bit
:OW
:T RS 1 Write ICRW back
:L =PADR Single peripheral access or access to the
: process image
:L RS 1
:LW =MASK Mask QVZ or ADF bit
:AW
:L RS 60 Write old ICRW back, so that the next
:T RS 1 QVZ or ADR can be detected
:TAK
:BE
User Memory Organization in the CPU 928B
CPU 928B Programming Guide
8 - 20 C79000-B8576-C898-01