Technical data

Appendix
27.6 Sample Programs
Programming with STEP 7
668 Manual, 05/2010, A5E02789666-01
27.6.4.4 Example of Masking and Unmasking Synchronous Errors
The following example of a user program illustrates how to mask and unmask synchronous errors.
Using SFC36 "MSK_FLT" the following errors are masked in the programming error filter:
Area length error when reading
Area length error when writing
With a second call of SFC36 "MSK_FLT" an access area can also be masked:
I/O access error when writing
With SFC38 "READ_ERR" the masked synchronous errors are queried. The "I/O access error
when writing" is unmasked again with SFC37 "DMSK_FLT."
Code Section
Below you will find the OB1 in which the example of the user program was programmed in
Statement List.
STL (Network 1) Explanation
AN M 255.0
JNB m001
CALL SFC 36
PRGFLT_SET_MASK :=DW#16#C
ACCFLT_SET_MASK :=DW#16#0
RET_VAL :=MW 100
PRGFLT_MASKED :=MD 10
ACCFLT_MASKED :=MD 14
m001: A BR
S M 255.0
Non-retentive memory bit M 255.0 (only in first
run = 0)
SFC36 MSK_FLT (mask synchronous errors)
Bit 2 = Bit 3 = 1 (BLFL and BLFS are masked)
All bits=0 (no access errors are masked)
Return value
Output current programming error filter to MD10
Output current access error filter to MD14
Set M255.0 if masking successful
STL (Network 2) Explanation
CALL SFC 36
PRGFLT_SET_MASK :=DW#16#0
ACCFLT_SET_MASK :=DW#16#8
RET_VAL :=MW 102
PRGFLT_MASKED :=MD 20
ACCFLT_MASKED :=MD 24
SFC36 MSK_FLT (mask synchronous errors)
All bits=0 (no further programming errors
masked)
Bit 3 = 1 (write access errors are masked)
Return value
Output current programming error filter to MD20
Output current access error filter to MD24
STL (Network 3) Explanation
AN M 27.3
BEC
Block end if write access error (bit 3 in
ACCFLT_MASKED) not masked