×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 46163827, Entry date: 08/31/2011
(4)
Rate

How do you prevent the PID Compact controller of the S7-1200 from switching off when the controller is switched off and on again and in the case of invalid process values?

  • Entry
  • Associated product(s)
This entry tells you how to put the "PID_Compact" controller V1 automatically back into "Automatic" mode from the "Idle" mode after troubleshooting.

Description
If invalid values are received from IO devices, the S7-1200 PID Compact controller switches to Idle mode. This entry presents a solution to avoid this behavior.

Invalid values at the analog current value input "Input_PER" of the "PID_Compact" block are "16#7FFF" and "16#8000". There can be several reasons for these invalid values.

For example:

  • After switching on the RTD module, the module runs an internal calibration of the analog-to-digital converter. During this time, the module reports a value of "32767" ("16#7FFF") on each channel until valid data is available.
  • These values can also occur with any analog input that goes into overflow or underflow.

Troubleshooting
Via the "Replace Output" connection of the "Signal Filter" function block you can define a safe output state of the "PID_Compact" block. When invalid values are received, the "Signal Filter" function block switches the "PID_Compact" to Manual mode, and "Replace Output" is used as the output value of the PID Compact instead of Idle mode. When valid values are received again, "PID_Compact" switches back to Automatic mode. The "ERROR" bit of the "SignalFilter" function block gives the user program an indication of error conditions that affect the operation of the "PID_Compact" function. IO errors (for example, wire break and short circuit) can cause such a state.

Note

  • Instead of the "Input_PER" connection of the "PID_Compact" function block you must connect each IO input of the controller to the "SignalFilter" function block.
  • The PID functions "Configuration" and "Commissioning" are not affected by the "SignalFilter" function block.
  • However, in the case of invalid actual values, you can no longer switch between Automatic and Manual mode because the PID controller is already in Manual mode.

Warning

  • If "SignalFilter" is used in combination with "PID_Compact", it is not possible to change the manual value in the "Commissioning" view.
  • The manual value can only be set via the "ManValueInput" input of the "SignalFilter" function.

Using the "Signal Filter" function block with the S7-1200 PID controller
 

No. Using the "SignalFilter" function block with the S7-1200 PID controller
1. Download and open the attached S7-1200 global library "PID_Compact_SignalFilter_Lib"
Proceed as follows:
  • Download, unpack, and open the attached S7-1200 global library "PID_Compact_SignalFilter_Lib.zip".
  • Click the "Open global library" button to open the library.
  • Drag and drop the "SignalFilter" library element into the program block folder of your project.
     


Fig. 01
 

2. Connect the "SignalFilter" function block
Proceed as follows:
  • Navigate to a network that has a "PID_Compact" function block.
  • Drag and drop the "SignalFilter" function block from the program block folder of your project into the network in front of the "PID_Compact" function block.
  • Connect the marked inputs of the "Signal Filter" and the "PID_Compact" function blocks as in Fig. 02. Details on the connectors are available in Table 02.
     


Fig. 02
 

Table 01

Connections of the "SignalFilter" function block
Use the inputs of the "SignalFilter" function block instead of the inputs of the "PID_Compact" function block. Connect the outputs to the corresponding inputs of the "PID_Compact" function block.
 

Connection Data type Remark
AnalogInput WORD Input for the actual value.
Instead of the "Input_PER" connection of the "PID_Compact" function block you must connect each IO input of the controller to the "SignalFilter" function block.
ReplaceOutput REAL Replacement value in insecure state.
ManEnable BOOL TRUE: The PID controller is set to Manual mode with the "ManValueInput" manual setpoint value.
ManValueInput REAL Input for the manual value which is used each time the "ManEnable" connector is "true".
PIDState INT Enter this variable at the "State" output of the "PID_Compact" block. This variable can be found also in the instance data block of the "PID_Compact" function block.
PIDMode INT Enter this variable at the "sRet.i_Mode" static parameter of the "PID_Compact" block. This variable can be found also in the instance data block of the "PID_Compact" function block.
PIDPerInput WORD Enter this variable at the "Input_PER" input of the "PID_Compact" block. This variable can be found also in the instance data block of the "PID_Compact" function block.
PIDManEnable BOOL Enter this variable at the "ManualEnable" input of the "PID_Compact" block. This variable can be found also in the instance data block of the "PID_Compact" function block.
PIDManValue REAL Enter this variable at the "ManualValue" input of the "PID_Compact" block. This variable can be found also in the instance data block of the "PID_Compact" function block.
ERROR BOOL TRUE if the input value is equal to "16#7FFF" or "16#8000".
Table 02

Sample project
The sample project attached, "PID_Compact_SignalFilter_Example.ap10", shows the functionality of "SignalFilter" function block.
It contains an executable project including "PID_Compact", "SignalFilter" and process simulation.
 


Fig. 03

OB200 "PID_Controller" contains the Signal Filter and the "PID_Compact" function block.
The "Process_PT3" function block for process simulation is called via OB201 "Process_Simulator".
 

No. Setting the "SignalFilter" function block in the S7-1200
1. Download, unpack, and open the attached S7-1200 project "PID_Compact_SignalFilter_Example.ap10".
2. Adapt the CPU use in the project to your hardware in the "Device view".
3. Download the project into the device.
4. Open the "Commissioning" of the "PID_Compact" block and start the measuring process.
 


Fig. 04
 

5. Open the "Watch_Table_1" monitoring table and start monitoring.
 


Fig. 05
 

6. Set the "MSetpoint" control value to "50.0".
 


Fig. 06
 

7. You can watch the step response in the PID commissioning view.
 


Fig. 07
 

8. Simulate the process error "7FFF" (or "8000") by modifying the "MSimErr" value to "1".
 


Fig. 08
 

You can configure the setpoint value in the monitoring table and simulate an IO error. You can enter the "7FFF" or "8000" parameter for the process error.

9. The PID controller switches into manual mode and returns the "ReplaceOutput" value.
 


Fig. 09
 

10. Reset the error simulation by modifying the "MSimErr" back to "0".
   


Fig. 10
 

11. The PID controller switches back to Automatic mode.
 


Fig. 11
 

12. Set the "ManEnable" input of the "SignalFilter" block.
 


Fig. 12
 

13. The PID controller switches to manual mode and returns the "ManValueInput" value.
 


Fig. 13
 

14. Reset the "ManEnable" input.
 


Fig. 14
 

15. The PID controller switches back to Automatic mode.
 


Fig. 15
 

Table 03

System environment

  • S7-1200
  • Ethernet cable
  • PG / PC
  • STEP 7 Basic V10.5

Validity
This entry is based on the PID Compact Controller V1.0. This is available as a technology object in STEP 7 Basic V10.5 and in STEP 7 V11.
With STEP 7 V11 there is also the PID Compact Controller as from version V1.1 (for firmware versions as from V2.0 of the S7-1200 CPU) with the Reset behavior below:
"A rising edge at "Reset" resets errors and warnings and deletes the I part. A falling edge at "Reset" switches to the mode that was last active."
With the following connection setup of the "Reset" input you can reset PID Compact controllers V1.1 and V1.2 after invalid process values occur.
In version V2.2 and higher of the "PID_Compact" you can set the behavior in case of error in the configuration settings.
 


Fig. 16

SignalFilter library
 
 Registrierung notwendig PID_CompactSignalFilter_Lib.zip (364,7 KB)

SignalFilter sample project
 
 Registrierung notwendig PID_CompactSignalFilter_Example.zip (1,7 MB)

 

 

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
https://www.siemens.com/cybersecurity#Ouraspiration.