How do you switch off (decouple) a slave without causing an error entry to appear in OB 86/OB 122?
A DP slave is to be disconnected from the bus system without an error entry appearing in the organization blocks OB 86/OB 122 in the associated DP master.
This requirement frequently arises in applications where a slave is not permanently on the bus for technological reasons. In order now to remove the slave from the master call list, you need to call the SFC 12 system function block in an OB or an FB. SFC 12 is a system function block and is one of the CPU's functions.
If you have disabled a DP slave with the SFC 12, its process outputs are set to substitute value 0 (safe status) or accept the configured substitute value behavior. The corresponding DP master no longer addresses this DP slave. Disabled DP slaves are not indicated as damaged or missing on the error LEDs of the DP master or CPU. If the slave is disabled, there are no error entries in the diagnostic buffer either.
When users try to access disabled stations, access errors occur. Disabled stations can be removed without a station failure being identified or without access errors occurring during process image updating.
Examples of SFC 12 calls
- Disable slave
CALL SFC 12
- Enable slave
CALL SFC 12
|REQ||Level-triggered control parameter|
0: Info slave enabled or disabled
1: Enable slave
2: Disable slave
|LADDR||Any logical address of the DP slave in HEX. The slave is uniquely assigned on the basis of the logical address|
|RET_VAL||Error code for return value|
1: The job is still active
0: The job has been completed
- A detailed description of the SFC 12 is available in the Online Help of the SIMATIC Manager.
- Whether the CPU you are using supports the SFC 12 can be seen in the operation list or the controller manual.
SFC 12 "D_ACT_DP" is called in organization block OB 1 in Network 2 and it disables the slave (ET 200M) if memory marker M 0.0 changes from 0 to 1. SFC 12 "D_ACT_DP" is called again in Network 3, however it enables the slave (ET 200M) if memory marker M 0.2 changes from 0 to 1. You can use the "VAT 1" variable table for test purposes.
The download contains a STEP 7 V5 project with the aforementioned sample calls of the SFC12 system function block in organization block OB1, an organization block OB86 for treating errors and a variable table. You can change the blocks as you wish to suit your requirements.
Sfc12.zip ( 85 KB )
Copy the "Sfc12.zip" file into a local directory. You can then dearchive the STEP 7 program in the SIMATIC Manager.