×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 18459342, Entry date: 06/23/2008
(6)
Rate

What should you watch out for when calling and assigning parameters to the controller functions in function blocks (S)FB41, (S)FB42 and (S)FB43?

  • Entry
  • Associated product(s)

Configuration notes:
The PID Control CONT_C, CONT_S and PULSEGEN control functions are available in two versions but with identical functions:

  • FB 41, FB 42, FB 43
    The loadable controller FBs are regular user blocks that run in all CPUs (S7-300, S7-400).
  • SFB 41, SFB 42, SFB 43
    The controller SFBs that are integrated into the operating system are in all S7-300 CPUs of the types 313C and 314C and in the C7 devices.

The controller blocks are available in the STEP 7 Standard Library (SIMATIC Manager: "File > Open > Libraries > ...") in the "PID Control Blocks" (FBs) folder or "System Function Blocks" (SFBs) folder.

When using these blocks, please watch out for the following points.

  1. FB 41 "CONT_C"
  • To guarantee a constant scanning frequency, the controller should be called in a cyclic interrupt OB without call-up conditions (e.g. OB35).
  • The "CYCLE" parameter corresponds to the scan time. The time between block calls must be configured here  (e.g. time base of the OB35).
  • The default controller setting is manual mode (MAN_ON=true). The control loop is interrupted. In this mode the variable matches the MAN manual value.
  • In order to ensure a smooth switchover from manual to automatic mode, at least two block cycles must be conducted in manual mode.
  • When the CPU is restarted, a block cycle should be conducted with "COM_RST" = true.
  • The "COM_RST" parameter can be used to block the controller.
  1. FB 42 "CONT_S"
  • To guarantee a constant scanning frequency, the controller should be called in a cyclic interrupt OB without call-up conditions (e.g. OB35).
  • The "CYCLE" parameter corresponds to the scan time. The time between block calls must be configured here (e.g. time base of the OB35).
  • The default controller setting is manual mode (LMAN_ON=true).
  • When the CPU is restarted, a block cycle should be conducted with "COM_RST" = true.
  • The "COM_RST" parameter can be used to block the controller.
  • The "PULSE_TM" and "BREAK_TM" parameters are to be set to a whole multiple of the "CYCLE" parameter.
  1. FB 43 "PULSEGEN"
  • To guarantee a constant scanning frequency, the pulse generator should be called in a cyclic interrupt OB without call-up conditions (e.g. OB35).
  • When the CPU is restarted, a block cycle should be conducted with "COM_RST" = true.
  • The "CYCLE" parameter corresponds to the scan time. The time between block calls must be configured here (e.g. time base of the OB35).
  • The FB43 can be operated together with a continuous controller such as FB41, but not with a step-action controller such as the FB42.
  • The "PER_TM" parameter must be set to the scan time value for the controller (FB41).
  • The call time for the FB41 is achieved via a clock distributor (for an example, refer to the Online Help for the FB43).

Note:
Since the OB1 does not guarantee a constant cycle time, no clear value can be assigned to the "CYCLE" parameter. If the "CYCLE" parameter does not match the scan time, then time-dependent control parameters (e.g. TI, TD) seem too fast or too slow.
You can find notes about descriptions and examples for the (S)FBs 41 - 43 in Entry ID: 16532187. The Online Help for the relevant block also contains useful advice.

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.