How do you receive an alarm with the SFB 54 "RALRM" in compliance with DPV1?
Heeft betrekking op product(en)
The following example shows how you can use the SFB 54 "RALRM" to receive and evaluate an alarm that has been issued by distributed I/O device. It includes the most important points for module parameterizing, programming and evaluating the data received.
In the example an S7-CPU 315-2DP (MLFB: 6ES7 315-2AG10-0AB0) is used as DPV1 master that operates an ET 200M with IM 153-2 HighFeature (MLFB: 6ES7 153-2BA00-0XB0) as distributed PROFIBUS interface. The power supply is interrupted on the analog I/O module (AI 2x12 bits) so that the DP slave reports an alarm to the DP master.
In order to be able to receive an alarm with the SFB 54 "RALRM", all the components involved must support the DPV1 standard. This means that both the master and the slave used must support the DPV1 standard and thus also alarm handling.
Once the HW Config has been established you must enable the alarm handling. For the ET 200M to be able to issue diagnostics alarms, these must be enabled in the parameters of the modules. Diagnostics alarms are disabled by default.
Then call the SFB 54 directly in the required alarm OB. In the example it is called directly in the diagnostics alarm OB (OB 82). If the SFB 54 is called in multiple alarm OBs, it must be called with different instance DBs to ensure error-free running of the block.
Take the content for parameter F_ID on SFB 54 from the HW Config (see Fig. T1-03). Here you need the I/O address of the module from which alarms are to be received. Note that the decimal value from the HW Config has to be converted into a hexadecimal format for the SFB 54. If you use Mode 1 just as in the example, the parameter F_ID is irrelevant.
Once a diagnostics alarm has been issued in the running project the SFB 54 fills the two data areas specified with administration information (DB1) on the one hand and on the other with all the alarm information received (DB2 - see Fig. 04).
This alarm information can now be evaluated as follows:
- You evaluate the first 3 bytes of standard alarm information with the Online Help of SFB 54.
- The additional alarm information (as from byte 4) can be evaluated using the manual for the distributed system concerned in each case. In the manual the Diagnostics chapter has a separate section on the topic of alarms.
If you are using the SFB 54 on a DPV0 slave, in the alarm information you receive the complete contents of the diagnostics message from the slave. This is described in detail in the Online Help of STEP 7 (keyword: "SFB 54").
DP_Diagnose_SFB54.zip ( 262 KB )