×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ, Entry ID: 42781105, Entry date: 09/20/2018
(9)
Rate

How do you diagnose IO access errors with the S7-1200?

  • Entry
  • Associated product(s)
In STEP 7 (TIA Portal) you program the diagnostic error interrupt OB and enable the necessary functions for the module to be diagnosed.


1. Evaluating the diagnostics error events with the diagnostic error interrupt OB


The IO access errors are also known as diagnostic errors. The following diagnostic errors are supported:

  • No encoder or load power (on the signal module / signal board)
  • High limit exceeded (of the value at an analog input or output)
  • Low limit exceeded (of the value at an analog input or output)
  • Wire break (at an analog current output)
  • Short circuit (at an analog voltage output)

All diagnostic error events trigger the execution of the diagnostic error interrupt OB. The diagnostic error interrupt OB includes startup information that helps you determine the circumstances of the error occurrence:

  • From which device and channel the error was reported.
  • Whether the event is due to the occurrence or removal of an error.

You can program instructions in the diagnostic error interrupt OB to examine these startup values and to take appropriate action. The occurrence or removal of any of several different diagnostic error conditions results in a diagnostic error event if the following conditions are met:

  • The program of the S7-1200 has a diagnostic error interrupt OB.
  • The diagnostics error event has been enabled for this module.

If there is no diagnostic error interrupt OB, then the CPU ignores the error. The diagnostic error interrupt OB interrupts the normal cyclic program execution as soon as a diagnostics-compatible module recognizes an error.

When you create a new project, there is not yet a diagnostic error interrupt OB available. Proceed as follows to program the diagnostic error interrupt OB:

  1. In the Project tree you open the folder structure of your PLC station and then the "Program blocks" folder.
  2. Double-click the "Add new block" function.
  3. In the "Add new block" dialog you click the "Organization block" button and in the selection list displayed you select "Diagnostic error interrupt" OB.
  4. Close the dialog with OK. After inserting the Diagnostic error interrupt OB in your program folder, the block is opened automatically.
    Note
    You can use only one "Diagnostic error interrupt" OB in the program. 


    Fig. 1
     
  5. To read out the startup information for the diagnostic error interrupt OB you insert the "MOVE" instruction three times in the program editor of the diagnostic error interrupt OB. The MOVE instruction is in the "Instructions" task card under "Basic instructions > Move operations".
  6. Parameterize the input parameter of each "MOVE" instruction with one of the input parameters of the diagnostic error interrupt OB ("IO_State", "LADDR" and "Channel").
  7. Parameterize the output parameter of each "MOVE" instruction with a DB tag that has the same data type as the input parameters of the diagnostic error interrupt OB.
  8. Program the error query ("MultiError") with a bit link.
     

    Fig. 2 

The diagnostic error interrupt OB has the following has the following startup information:

  • IO_State: State of the hardware object
  • LADDR: Hardware ID of the hardware object that has triggered the diagnostic error interrupt
  • Channel: Channel number
  • MultiError: Signal "True" if there is more than one error

The hardware identifier (HW ID) identifies modules or functional units of modules (for example outputs and high speed counters). This integer is transferred by the system along with diagnostic error interrupts to allow the faulty module or functional unit to be localized.

To find the hardware ID, in the device configuration you open the properties of the module and select the "System constants" tab (Fig. 3).
 


Fig. 3 

2. Enabling and understanding the different diagnostic error events


The operating system monitors the diagnostics-compatible devices for the diagnostic errors mentioned above. Diagnostic error events are indicated by flashing red LEDs. In the following you see additional information about the different diagnostic error events and how to enable them.

  1. In the Project tree you open the folder structure of your PLC station and then double-click "Device configuration".
  2. In the device configuration you double-click the object where you want to enable the diagnostic error events.

Now, in the inspector window of the "General" tab, you can edit the displayed properties and parameters of the selected object.
 

1.

No encoder or load power
The power supply is insufficient or missing.

The following S7-1200 LEDs start to flash (LED color: red):

  • The "ERROR" LED on the CPU.
  • All LEDs of the signal module / signal board.

You enable the power supply diagnostics as follows:

  1. In the area navigation you click the "AI 4/AQ 2" folder.
  2. Enable the option "Enable power supply diagnostics".
     

    Fig. 4 
2."High limit exceeded"
The high limit of an analog input / output has been exceeded (output value greater than "+32511").

The following S7-1200 LEDs start to flash (LED color: red):

  • The "ERROR" LED on the CPU.
  • The "DIAG" LED if it is a signal module.
  • The LED of the associated channel. 

You enable the overflow diagnostics as follows:

  1. In the area navigation you open the "AI 4/AQ 2" folder and click "Analog inputs".
  2. Enable the option: "Enable overflow diagnostics".


Fig. 5
3."Low limit exceeded"
The low limit of an analog input / output has been exceeded (output value for current less than "0", for less than "-32512").

The following S7-1200 LEDs start to flash (LED color: red):

  • The "ERROR" LED on the CPU.
  • The "DIAG" LED if it is a signal module.
  • The LED of the associated channel. 

You enable the underflow diagnostics as follows:

  1. In the area navigation you open the "AI 4/AQ 2" folder and click "Analog inputs".
  2. Enable the option: "Enable underflow diagnostics".

See Fig. 05 for more details. 

4."Wire break"
The circuit of an analog Current output is not closed.

The following S7-1200 LEDs start to flash (LED color: red):

  • The "ERROR" LED on the CPU.
  • The "DIAG" LED if it is a signal module.
  • The LED of the associated channel. 

 You enable the wire break diagnostics as follows:

  1. In the area navigation you navigate to the desired channel, for example: "AI 4/AQ 2 > Analog outputs > Channel1".
  2. For measurement type or analog output type you select "Current".
  3. Enable the option "Enable broken wire diagnostics".



Fig. 6
5."In the area navigation"
The contacts of an analog Voltage output are short-circuited.

The following S7-1200 LEDs start to flash (LED color: red):

  • The "ERROR" LED on the CPU.
  • The "DIAG" LED if it is a signal module.
  • The LED of the associated channel. 

 You enable the short circuit diagnostics as follows:

  1. In the area navigation you navigate to the desired channel, for example: "AI 4/AQ 2 > Analog outputs > Channel1".
  2. For analog output type you select "Voltage".
  3. Enable the option "Enable short circuit diagnostics".



Fig. 7


3. Online diagnostics with STEP 7 (TIA Portal)


If you can also access your S7-1200 CPU online with STEP 7 (TIA Portal), then you can make use of the "Online & diagnostics" function.

  1. In the Project tree you mark the CPU to be diagnosed, "PLC_1 [CPU 1215C DC/DC/DC]", for example.
  2. In the toolbar you click the "Go online" function.
  3. Then in the Project tree you double-click "Online & diagnostics".
  4. In the "Online access" dialog you mark the "Diagnostics buffer" item.
  5. In the "Events" table you select a diagnostics error event.
  6. Details of the selected event are shown underneath the "Events" table.

Note
"Incoming event" indicates the beginning of an event.
"Outgoing event" indicates the end of an event.


4. Further Information

More information is available in the following table:

Entry type Link 
ManualDiagnostics buffer (S7-1200) 
ManualDiagnostic error interrupt OB (S7-1200) 
ManualDisplay diagnostics events in the CPU 
ManualGo online to monitor the values in the CPU 
FAQHow do CPUs of the S7-1200/S7-1500 series react in the case of IO access errors to the input parameters of a block? 
FAQHow do you implement module and channel diagnostics in the user program of the SIMATIC S7-1200/1500? 

 

Creation Environment
The screens in this FAQ response were created with STEP 7 (TIA Portal) V15.