You can use system functions to disable calling of the error OB in the event of a syn- chronous error event, or enable it again, and also query which synchronous error events have occurred. Fig. 5.30 shows the graphic representation of the system functions.
Error masks
You use the error masks to control the system functions for handling synchronous errors. A bit is present in the programming error mask for each detected program- ming error, and in the access error mask for each detected access error. When spec- ifying the error mask, you set the bit which corresponds to the synchronous error
you wish to mask, unmask, or query. The error masks returned by the system func- tions indicate the synchronous errors which are still masked or present by signal state “1”.
The assignments of the access error mask are shown in Table 5.8, where the
“Error code” column shows the assignment of the OB122_SW_FLT tag in the start information of OB 122.
The assignments of the programming error mask are shown in Table 5.9. The Error code column shows the assignment of the OB121_SW_FLT tag in the start informa- tion of OB 121. The bits of the error masks not listed in the table are not relevant to the handling of synchronous errors.
MSK_FLT Mask synchronous error events
By means of the error masks, the system function MSK_FLT disables calling of the synchronous error OBs. By means of signal state “1” you identify in the error masks for which synchronous errors the OBs are not to be called (the synchronous error events are “masked”). The specified masking is used in addition to the masking saved in the operating system. MSK_FLT signals in the function value whether a (saved) masking was already present (16#0001) for at least one bit for the masking specified in the input parameters.
MSK_FLT returns all currently masked events with signal state “1” in the output pa- rameters.
Fig. 5.30 System blocks for handling of synchronous error events
Table 5.8 Assignment of access error mask Bit Error code Assignment
2 B#16#42 I/O access error when reading
The module is not present or does not acknowledge 3 B#16#43 I/O access error when writing
The module is not present or does not acknowledge
MSK_FLT DMSK_FLT READ_ERR
SFC 36
Mask synchronous error events
SFC 37
Unmask synchronous error events
SFC 38
Read event status register
Handling of synchronous error events
PRGFLT_
SET_MASK
PRGFLT_
RESET_MASK
PRGFLT_
QUERY ACCFLT_
SET_MASK
ACCFLT_
RESET_MASK
ACCFLT_
QUERY
RET_VAL RET_VAL RET_VAL
PRGFLT_
MASKED
PRGFLT_
MASKED
PRGFLT_
CLR ACCFLT_
MASKED
ACCFLT_
MASKED
ACCFLT_
CLR
If a masked synchronous error event occurs, the corresponding OB is not called and the event is not entered in the event status register. Masking applies to the current priority class (program execution level). If you mask the call of a synchronous error OB in the main program, for example, the synchronous error OB is nevertheless called if the error occurs in an interrupt routine.
DMSK_FLT Unmask synchronous error events
By means of the error masks, the system function DMSK_FLT enables calling of the synchronous error OBs. By means of signal state “1” you identify in the error masks the synchronous errors for which the OBs are to be called again (the synchronous error events are “unmasked”). The entries in the event status register correspond- ing to the specified unmasking are deleted. DMSK_FLT signals with W#16#0001 in the function value if no (saved) masking was present for at least one bit for the un- masking specified in the input parameters.
Table 5.9 Assignment of programming error mask Bit Error code Assignment
1 B#16#21 BCD conversion error (pseudo tetrad during conversion)
2 B#16#22 Area length error when reading (operand outside permissible range) 3 B#16#23 Area length error when writing (operand outside permissible range) 4 B#16#24 Area error when reading (incorrect area in area pointer)
5 B#16#25 Area error when writing (incorrect area in area pointer) 6 B#16#26 Faulty number of a timer function
7 B#16#27 Faulty number of a counter function 8 B#16#28 Address error when reading
(bit address <>0 with byte, word or doubleword access with indirect addressing) 9 B#16#29 Address error when writing
(bit address <>0 with byte, word or doubleword access with indirect addressing) 16 B#16#30 Write error with global data block (read-only block)
17 B#16#31 Write error with instance data block (read-only block) 18 B#16#32 Faulty number of a global data block (DB register) 19 B#16#33 Faulty number of an instance data block (DI register) 20 B#16#34 Faulty number of a function FC
21 B#16#35 Faulty number of a function block FB 26 B#16#3A Called data block DB does not exist 28 B#16#3C Called function FC does not exist 30 B#16#3E Called function block FB does not exist
DMSK_FLT returns all currently masked events with signal state “1” in the output parameters.
If an unmasked synchronous error event occurs, the corresponding OB is called and the event is entered in the event status register. Unmasking applies to the current priority class (program execution level).
READ_ERR Read event status register
The system function READ_ERR reads the event status register. With signal state “1”
you identify in the error masks the synchronous errors for which you wish to read the entries. READ_ERR signals with W#16#0001 in the function value if no (saved) masking was present for at least one bit for the selection specified in the input parameters.
READ_ERR returns the selected events with signal state “1” in the output parame- ters when they have occurred and deletes these events in the event status register when scanned. Synchronous errors which have occurred in the current priority class (program execution level) are signaled.