15.16
Determining the type of wire break condition from an SM 1231
module
As described in the topic Measurement ranges of the analog inputs for voltage and current
(SB and SM) (Page 1471), the SM 1231 module returns an analog input value of 32767
(16#7FFF) for both a wire break condition or an overflow condition. If you want to determine
which of these two conditions occurred, you can include logic in your STEP 7 program to
make the determination. The method to determine the condition type consists of these tasks:
● Create a Diagnostic error interrupt OB to be called whenever there is an incoming or
outgoing diagnostic event.
● Include a call to the RALRM instruction.
● Set up an array of bytes for the AINFO parameter, which includes the information about
the condition type.
● Evaluate bytes 32 and 33 of the AINFO structure of the RALRM_DB when the CPU
triggers the Diagnostic Interrupt OB..
Creating a Diagnostic error interrupt OB
To be able to determine when a wire break condition occurs, create a Diagnostic error
interrupt OB. The CPU will call this OB whenever an incoming or outgoing diagnostic event
occurs.
When the CPU calls the Diagnostic error interrupt OB, the input parameter LADDR will
contain the hardware identifier for the module with the error. You can find the hardware
identifier for the SM 1231 module in the STEP 7 device configuration for the SM 1231
module.
Calling the RALRM instruction
To program the RALRM instruction call, follow these steps:
1. Add a call to RALRM in your STEP 7 program.
2. Set the F_ID input parameter to the hardware identifier in the LADDR parameter of the
Diagnostic error interrupt OB.
3. Use an array of bytes for the TINFO and AINFO input parameters. Use an array size of
34 bytes or greater.
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
15.16 Determining the type of wire break condition from an SM 1231 module
Online and diagnostic tools
1349