Siemens Industry Online Support
Siemens AG
Entry type: Download Entry ID: 5608020, Entry date: 10/16/2014

How do you switch off (decouple) a slave without causing an error entry to appear in OB 86/OB 122?

  • Entry
  • Associated product(s)

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
            REQ :=E0.0
            BUSY :=A4.0

  • Enable slave

            CALL SFC 12
            BUSY :=A4.1


Parameter Description
REQ Level-triggered control parameter
MODE Mode:
0: Info slave enabled or disabled
1: Enable slave
2: Disable slave

In Alarm mode DPV0, the CPU goes into "STOP" mode if the DP slave is enabled with SFC 12 (MODE=1). Use Alarm mode DPV1 to disable and enable the DP slaves with SFC 12.

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
BUSY Status:
1: The job is still active
0: The job has been completed
Table 1: Description of parameters


  • 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.

Sample program
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.


Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit