show the entry list

ES - SIMATIC Manager -- Creating programs -- Using SFC 
How do you reset error outputs without starting the productive sequencer? 
How do you disable step time monitoring in the "Holding" mode? 
What effect do the values "with" and "none" have in the "Enumeration" setting for setpoint values in SFC types and SFC instances? 
What should you watch out for when using SFC charts/SFC type instances for delta loading, whose sequencers are processed in the "IDLE" state? 
Why do you get the error message "Missing or invalid identifier" in the SCL compiler after upgrading from PCS 7 V6.1 to PCS 7 V7.0? 
How can you change the message texts of an SFC chart in PCS 7? 
What is the maximum number of transitions and alternative branches permissible in an SFC chart? 
How do you make SFCs dynamic with Dynamic Wizard? 
What should you watch out for when making online changes to the structure of an SFC types? 
When do you use the Operation Type (EOP) technical function and when do you use the Function Type (EPH) technical function when defining your SFC type? 
How do you use the "AUX_PRxx" inputs for message-associated values of an SFC instance? 
How can you prevent the output LI_ERR being set on the SFC_CTRL block? 
How can you start an SFC chart /SFC instance in the AUTO process mode by way of the block inputs? 
How do you configure an operator request in an SFC type? 
How do you proceed when there is a failure upon opening an SFC chart or SFC type in the SIMATIC Manager? 
How do you optimize the size of the work memory for an SFC type? 
How do you determine the size of the work memory which is occupied by an SFC type? 
How do you leave one SFC sequencer and continue processing in another sequencer at a fixed target position? 
How can you monitor an SFC type "online" (in test mode)? 
What operating modes does the SFC have and what options are available for configuring sequencers? 
How can you display the current operational status of a sequencer? 
How can you display the operational display of a sequencer with a message of the SFC type instance? 
How can pre- and afterprocessing be used in the sequence features of the SFC at SIMATIC PCS 7 V6? 
When do I use a SFC-Chart and when a SFC-Type in SIMATIC PCS 7? 
How do you visualize the current runtime of a step of an SFC sequence? 
How do you configure an SFC type to ensure automatic interconnection of the block contacts? 
How can you display the operational status of a sequencer with a message of a separate message-compatible block? 
How can you resume a SFC sequence at the point of abortion upon restart of the CPU? 
How do you switch an SFC chart into automatic mode? 
What should you watch out for when doing a delta download of an SFC chart? 
How do you expand user created blocks or standard blocks from the PCS 7 library so that they are listed in the Properties dialog of the SFC editor? 

How do you reset error outputs without starting the productive sequencer?Go to beginning
Part number:

Description
If the "Initialization after CPU restart" option is set on the SFC or on the SFC instance, then there are still some error outputs set on the SFC or on an SFC instance after a warm restart. These are reset only after starting the SFC or the SFC instance.

In order to have the error outputs reset without starting the productive sequencer of the SFC or the SFC instance, you need an additional sequencer (for each SFC or SFC type).

Proceed as follows.
 
No. Procedure
1 Inserting an additional sequencer
  • Generate a new sequencer in the SFC chart and position it in front of the existing sequencers. The sequencer does not need any other processing steps.


Fig. 01: RESTART sequencer

  • Configure the start conditions of the sequencer (Edit > Sequencer properties...) with "RUN = RUN" and "TRIG_CPU_RESTART = TrigCPURestart".


Fig. 02: Sequencer start conditions

  • Reset the value of "TRIG_CPU_RESTART" in the "END" step of the sequencer.


Fig. 03: Configuring the END step

2 Changing the regular sequencers
  • Configure the "TRIG_CPU_RESTART = 0" start condition in addition for all the other sequencers of the CFC chart.


Fig. 04: Start conditions of the regular sequencers

Keywords
PCS 7

How do you disable step time monitoring in the "Holding" mode?Go to beginning
Part number:

Description
If step time monitoring is configured on the SFC chart, an error is triggered as soon as the maximum time is exceeded. If the operator or a configured process stops the sequence within a step ("Holding" mode), the processing time of the step last processed continues to run. Once the maximum time is reached, an error is triggered even if the transition conditions have already been fulfilled.


Fig. 01: Step time error in "Holding" mode

Instructions
Perform the following steps to temporarily disable step time monitoring.
 
No. Procedure
1 Create "Holding" sequence
Create another sequence in your SFC chart. Define the start condition "Holding" for this sequence. You can skip this step if you have already configured a sequence with this start condition.


Fig. 02: Sequence start condition

2 Disable step time monitoring in the "Holding" step sequence
Open the Properties of the start step in the sequence with the "Holding" start condition. Configure the "TIMEMON := 0" statement in either the "Initialization" or the "Processing" action.


Fig. 03: Configure statement

3 Re-enable step time monitoring after continuing processing
In the sequences in which step time monitoring has to be enabled, you open every step and insert the "TIMEMON := TimeMon" statement. You configure this statement in the "Termination" action of each step.
If the "Continue" command causes a return to the sequence, step time monitoring is re-enable from the next step on.


Fig. 04: Insert "TIMEMON" in the "Termination" action

Creation environment
The pictures in this FAQ were created with PCS 7 V7.1.

What effect do the values "with" and "none" have in the "Enumeration" setting for setpoint values in SFC types and SFC instances?Go to beginning
Part number:

Description
Enumerations are used, for example, to be able to select a name instead of a number when specifying setpoint values. You can create enumerations in the SIMATIC Manager under "Global Declarations".
When setting the enumerations (e.g. "Color") a name (e.g. "Red") is assigned a unique number (e.g. 25). Thus, when parameterizing the block, you can select the name of the color ("Red" in the example), but the corresponding value (25 in the example) is transferred.
Using enumerations you can prevent incorrect value specifications and at the same time limit the number of values that can be set.

When creating SFC types, you can use enumerations for specifying the setpoint values of data types BOOL, INT, DINT, DEST, SOURCE and VIA. In the case of non-batch-relevant SFC types there are 3 ways of setting the enumerations. In the case of batch-relevant SFC types there is an exception (see table).
 
Setting Meaning
<none> It is not possible to specify an enumeration when configuring the SFC instance in the CFC editor.
When using a Boolean setpoint value, via the Properties you can use the designations "Text0" for the "False" state and "Text1" for the "True" state.
<with> You can select an enumeration for the setpoint value when configuring the SFC instance. No enumeration is preselected.

Note
You cannot make this setting for batch-relevant SFC types.
However, it is possible to change the enumeration in the SFC instance. Use the following procedure:

  • Select the SFC instance in the CFC and open the SFC editor via the pop-up menu.
  • You can select an enumeration in the "Enumeration" column under "Setpoint values".
Special enumeration
(e.g. "Color")
You can select an enumeration for the setpoint value when configuring the SFC instance. The enumeration set ("Color" in the example) is preselected.

Note
Information about the Global Declarations is available in the PCS 7 Help under
"Configuration - Engineering System" > "Configuring the PCS 7" > "Creating the Master Data Library" > "How to Save Global Declarations".

Instructions
The following instructions describe how to create a non-batch-relevant SFC type that uses an enumeration for specifying the setpoint value.
 
No. Procedure
1 Select the "Charts" folder of the PCS 7 project in the SIMATIC Manager.
2 In the menu bar click on "Insert > S7 Software > SFC Type".
3 In the pop-up menu of the inserted SFC type you select the menu command "Object Properties".
4 Click on the "Options" tab and in the "Category" drop-down list of the "SIMATIC BATCH" group you select the "none" item. Then close the dialog box with "OK". 

Note

  • If you select the item "none" (as specified), you create a non-batch-relevant SFC type.
  • If you select the item "EOP" or "EPH" item, you create a batch-relevant SFC type.
5 Open the SFC type in the SFC editor and select the menu command "View > Characteristics".
6 Click on "Setpoint value" in the tree view. Enter the name of the setpoint value and click in the "Enumeration" column of the setpoint value (horizontal scrollbar available).

Click on the triangle next to the preset value to select an enumeration or the "<with>" and "<none>" settings described.

Version
This entry has been tested with the versions below.
 
Component Product and version designation
PC operating system Microsoft Windows XP SP3
Standard tools PCS 7 V7.1
HMI software ---
Options ---
Controllers  

What should you watch out for when using SFC charts/SFC type instances for delta loading, whose sequencers are processed in the "IDLE" state?Go to beginning
Part number:

Description
If you are using SFC charts/SFC instances with one or more sequencers in your project, which are active in the "IDLE" state (Fig. 01), then you must note the following system behavior as described below.


Fig. 01: Active sequencer in the "IDLE" state

There might be an unwanted change from the "IDLE" state to the "RUN ON" state when you change the interface or topology of an SFC chart/SFC type and set the Start option of these SFC charts/SFC instances after delta loading.

Note
Topology change: Add/delete/move step/transition/jump or change jump destination.

Description of system behavior for delta loading.
 
No. Description
1 Checking for changed SFC charts/SFC instances
Upon delta loading, all the SFC charts/SFC instances that process a sequencer are recognized as "active". A list is also made of the SFC sequences that process the sequencers in the "IDLE" state. You then get a message indicating that the modified SFC charts/SFC instances have to be disabled.


Fig. 02: Disable SFC

2 Waiting period for disabling the SFC sequence
In the dialog that follows you can specify a maximum waiting period for disabling the SFC sequence.


Fig. 03: Maximum waiting period

3 Starting the switched off SFC sequences
An unwanted switch to the "RUN ON" state can only be prevented if the operator knows exactly which SFC sequence was in "RUN ON" and which in the "IDLE" state.

You must not select the SFC charts/SFC instances that were in the "IDLE" state.


Fig. 04: Starting SFC charts

Creation environment
The pictures in this FAQ were created with PCS 7 V7.1.

Why do you get the error message "Missing or invalid identifier" in the SCL compiler after upgrading from PCS 7 V6.1 to PCS 7 V7.0?Go to beginning
Part number:

Initial situation:
In SFC types, you have the option of using the characteristics editor to create parameters for technological configuring. The user is free to assign names at will. When you define characteristics, you create and parameterize setpoint values, for example. From this definition the characteristics editor generates the required connections that are displayed when you switch to the interface editor and which you can use for configuring the sequencing logic. The connection names are formed automatically by adding a suffix to the names of the characteristics.

If you create the characteristic SW1 of the Real type as setpoint value in PCS 7 V7.x, then the connections generated look like this:
 

Fig. 01

However, if you create the characteristic SW1 of the Real type as setpoint value in PCS 7 V6.1, then the connections generated look like this:


Fig. 02

In the two previous screenshots, you see among other things a change in the name generated by the system from "SW1_ERROP" (PCS 7 V6.1) to "SW1_ERR" (PCS 7 V7.x).

Description:
You now have the option of defining your own contacts in addition to those generated by the system. If in PCS 7 V6.1 you have defined a connection named "SW1_ERR" in addition to the "SW1_ERROP" connection, then after upgrading to PCS 7 V7.x, it exists in duplicate through the change of contact name described above. This means that after you have "converted" your charts in PCS 7 V7.x and compilation of the charts has been completed, you get an error message from the SCL compiler (Fig. 04).


Fig. 03


Fig. 04

The error message "Identifier already exists" (Fig. 04) is caused by the connection names in duplicate. The name of the user-defined connection has been changed by the system from "SW1_ERR" to "SW1_ERR_1", but this change is not sufficient. The connection generated by the system now has been assigned the name "SW1_ERR", which you can recognize by the "ERR OP" comment (Fig. 05).


Fig. 05

Solution:
You must change the connection name changed by the system (SW1_ERR_1 in the example) manually to SW1_ERROR, for example. After making this change, compilation of the charts is completed without any error messages.


Fig. 06

Note:
To detect duplicated identifiers you must select the "Generate SCL source" option when compiling. This provides you the option through manually compiling the SCL source of having the error message "... Identifier already exists" also reported in the SCL editor. Now, double-click on this error message and the cursor jumps directly to the identifier that is causing the error message.

Keywords:
Upgrade

How can you change the message texts of an SFC chart in PCS 7?Go to beginning
Part number:

Description:
The block FB300 ("@SFC_RTS") is the SFC runtime system that is copied automatically into the block folder of your S7 program each time an SFC chart is created from the SFC library.
In the FB300 of your S7 program, in the Blocks folder, you can open a dialog which displays the message texts of the current S7 program SFCs. You can also change the message texts in this dialog. For this, in the Blocks folder of your S7 program, you right-click to open the pop-up menu of the FB300 and there you open the message dialog under "Special Object Properties > Message...". When you add a new SFC, these changes are overwritten with the message texts of the FB300 from the SFC library.

Instructions:
You make general settings in the SFC library in block FB300. These settings are then applied the next time you insert an SFC chart. The changes are only effective for any SFC charts created as of this point in time. Changes to message texts in the FB300 are effective in all SFC charts as long as the message text line just changed has not yet been changed in the SFC. If you set a check mark in the column marked by a padlock, you lock the text shown in the previous column. In this case, the text in the SFC chart is grayed out and cannot be edited.


Fig. 01

You get the following view of the message dialog in the block container of your S7 program. Changes to message texts in the FB300 in the block container are effective in all SFC charts as long as the message text line just changed has not yet been changed in the SFC.


Fig. 02

You get the following dialog displayed in the SFC chart.


Fig. 03

In this way, all the texts for the message identifiers SIG2 to SIG8 for this SFC can be changed by default and are retained even when a new SFC chart is inserted.

Note for PCS 7 V7.0 SP1:
In PCS 7 V7 SP1, all the check marks are set by default in FB300 of the SFC library, so that when an SFC chart is created, all the message texts in the message dialog of the SFC chart are grayed out and thus cannot be changed. To be able to change the message texts, in the SFC library, in FB300 you must remove the check marks from the message identifiers SIG2 to SIG8 before you create an SFC chart.


Fig. 04

If you do not make the changes, you get the following dialog field in the message dialog of the SFC chart.


Fig. 05

Keywords:
Message configuration

What is the maximum number of transitions and alternative branches permissible in an SFC chart?Go to beginning
Part number:

Description
You can integrate a maximum of 255 transitions in one SFC chart. If you use all these for alternative branches, you cannot integrate any more transitions into the SFC chart. Then it is no longer possible to expand the chart.

How do you make SFCs dynamic with Dynamic Wizard?Go to beginning
Part number:

Description
Proceed as follows to enter the Wizard Script:

  1. Open Explorer and double-click to start the file <...\Siemens\WinCC\Bin\DynWizEdit.exe>
    => DynWizEdit opens.
  2. In the dialog box below the menu bar set the required language.
  3. Open the menu <Dynamic Wizard> -> <Read Wizard Script>
    => The <Open> window opens with a list of all the available Wizard Scripts.
  4. Find the <SFCScript.wmf> file in the list and open it.
    => The Wizard Script is then entered and the message "0 Error(s), 0 Warnings" is displayed in the <Output window> window.
  5. This indicates that the Wizard Script has been successfully entered and compiled. Now close the DynWizEdit.

Making an SFC dynamic in the Graphics Designer:

  1. Open your image with the Graphics Designer, enter an OLE control from the object palette and select the type <SFC Control> from the <Insert OLE Control (OCX)> list. Acknowledge with <OK>.
  2. Open the Dynamic Wizard and click the (now newly available) tab <SFC>.
  3. Start the Wizard by double-clicking the Wizard Script <Configuring>.
  4. Run the Wizard and select the required SFC plan from the list and the display type <Overview or Excerpt>.
  5. Save your image and test the function in runtime.
What should you watch out for when making online changes to the structure of an SFC types?Go to beginning
Part number:

Description  
When making structural changes to an SFC type you have to compile and load both the PCS 7 AS(s) and the PCS 7 OS(s), and SIMATIC BATCH. Here operator mistakes might occur in the time when there is a different structure in the AS to that in the OS or in SIMATIC BATCH.

For this reason you should not make such changes if work is being done with these sequencers during the load procedure. This means that if you have changed the SFC type and updated the instances, then you must ensure that after loading the AS the changed SFC types are no longer operated in the PCS 7 OS and also that no functions in SIMATIC BATCH access these SFC types until the OS station and the batch system have also been loaded successfully.

When do you use the Operation Type (EOP) technical function and when do you use the Function Type (EPH) technical function when defining your SFC type?Go to beginning
Part number:

Description:    
For any SFC type you can set the Operation Type (EOP) technical function, the Function Type (EPH) technical function or no default as options for SIMATIC BATCH. 

Meaning:

  • <None>... No classification takes place for SIMATIC Batch.

  • EOP (Operation Type)  ... The SFC type is classified as an "Operation Type". Type information about: 
    · EOP blocks saved in the CFC charts and the IEPAR blocks linked to them.
    · SFC types (EOP instance) instanced in the CFC charts, along with their attributes (parameters).

    Following transfer to SIMATIC Batch the data is available for the ROP steps (recipe operations). An operation type should be selected for a complex function which is being automated. 

    --> The complexity has already been compiled here in the PLC; consequently, "little" remains to be done in the recipe in SIMATIC Batch.

  • EPH (Function Type)    ... The SFC type is classified as a "Function Type". Type information about: 
    · EPH blocks saved in the CFC charts and the IEPAR blocks linked to them.
    · SFC types (EPH instance) instanced in the CFC charts, along with their attributes (parameters).

    Following transfer to SIMATIC Batch the data is available for the RF steps (recipe functions). A function type should be selected for a simple function which is being automated. 

    --> The complexity is compiled here in the recipe and is thus essentially controlled by Batch. 

    Note:
    When the function type is used, only one instance of the SFC type is permissible per subsystem in the Technological Hierarchy.


Fig. 1: Opening and setting the Technical Function of an SFC type

Note:
If these are the properties of an SFC instance, no changes may be made (the fields are grayed out).

How do you use the "AUX_PRxx" inputs for message-associated values of an SFC instance?Go to beginning
Part number:

Description
The inputs "AUX_PR04" to "AUX_PR10" for SFC Type/SFC Instance can be used for associated values of the messages for SFC Type/SFC Instance. The associated values can be parameterized as actions in the sequencer or as interconnection on the block of the SFC instance.
An SFC chart does not permit you to configure process-associated values. The parameters "AUX_PRO4" to "AUX_PR10" are not available here.

Instructions
Proceed as follows to transfer process-associated values via interconnection on the instance block.
 
No. Procedure
1 Show input parameters
  • Open the object properties of the instance of an SFC type that you have inserted in the CFC chart.
  • Open the "Connections" tab.
  • Remove the selection for the parameters "AUX_PR04" to "AUX_PR10" in the "Hidden" column.


Fig. 01: Block connections "AUX_PR04" to "AUX_PR10"

2 Interconnect block connections
Pay attention to the points below when interconnecting.
  • The parameters "AUX_PRO4" to "AUX_PR10" are of the "ANY" data type. Interconnection of the data types "BOOL, BYTE, WORD, DWORD, CHAR, INT, DINT, REAL, DATE, TOD, TIME, S5TIME, DATE_AND_TIME" is permitted.
  • Do not leave any gaps at the inputs. If, for example, nothing is interconnected at "AUX_PR06", associated values are not transferred to "AUX_PR07" to "AUX_PR10".
  • The maximum amount of data that can be transferred is limited toe 480 bytes. There is information available on this in the manual entitled "System software for S7-300/400 system and standard functions" in Entry ID: 44240604


Fig. 02: REAL process-associated values at the block input

3 Configure message texts
You can parameterize message texts on the block of the SFC instance or on the associated FB of the SFC type. The message texts on the FB apply for all instances. The message texts at the instance are individual whereby locked standard message texts cannot be changed.

The message-associated values are not displayed by default at the SFC faceplate because the columns "Process_value_1" to "Process_value_10" are hidden. Proceed as follows to display the associated values in the message text.

  • Open the object properties of the SFC instance.
  • In the "Special Properties" area you click the "Message..." button.
  • Select a free signal (SIG2 to SIG8). You can set this signal via an action in the sequencer that is supposed to trigger an alarm message.
  • Select an appropriate message class.
  • Enter the desired message text in the "Event" column. For the associated value you enter the format instruction "@4%3.2f@", for example:
    • 4 stands for the associated value "AUX_PR04".
    • 3.2 stands for 3 places before and 2 places after the decimal point.
    • f stands for a floating point number.
    More information on the configuration of the format instruction is available in Entry ID: 25158897.


Fig. 03: Message configuration on the SFC instance

4 Compile and download AS/OS
Compile and download the AS program. In the case of a delta download the message-associated values are transmitted only after a STOP/RUN transition. Alternatively, you can do a complete download.
To avoid an AS STOP you can load the instance DB of the SFC instance in the AS program after the delta load.
  • Determine the instance DB of the SFC instance (object properties).
  • Open the Online view of the AS program.
  • Copy the corresponding DB from the Offline view into the Online view.

Compile and load the changes of the OS.

5 Display of messages on the OS
After the message is triggered it is displayed in the Message view of the SFC faceplate and in the alarm message system of PCS 7.

Creation environment
The pictures in this FAQ were created with PCS 7 V7.1 SP1.

 

How can you prevent the output LI_ERR being set on the SFC_CTRL block?Go to beginning
Part number:

Description
It is absolutely necessary that either the input "CMODINI" or the input " EN_OM" is set.
This also applies for the inputs "SCT" and "SGC".
It is also important that the inputs "OM_BY_LI" and "LM_BY_LI" are only set or reset by pulses. A permanent 1 signal is not permissible.
The inputs "T_OPRQCA" and "S_ERRCA" may also only be acknowledged as pulses after occurrence of an error.

Only one command can be set (START, STOP, ABORT, RESTART).

Important
For working through the SFC steps it is important that the input INSTOUT is set, otherwise no commands are output.

Keywords
Block interconnection

How can you start an SFC chart /SFC instance in the AUTO process mode by way of the block inputs?Go to beginning
Part number:

Initial situation:
The SFC chart/SFC instance in automatic mode does not run through the configured operating states after being started on the block. In MANUAL mode everything works correctly when operating on the OS station.

Description:
One possible cause is explained below.
There is an output on the SFC type "QDIS_START" that is declared as a BATCH variable. However, it is a start lock that indicates whether the sequencer is processed correctly. This start lock can be released through the input "PARAM=1". This input variable is also declared as a BATCH variable. With this configuration, you can control the SFC chart/SFC instance without problems even in automatic mode.



Fig 1: Setting the "PARAM" connection on the SFC type and display of the start lock

In order to start SFC chart/SFC instance in automatic mode, at least the following connection/assignment of the inputs is required:

  1. ENAUT=1 ; AUT=1 ; ENSTART=1 ; ENASTART=1
  2. PARAM=1
  3. PARAM=0
  4. Start=1 -> Sequencer goes into Run
  5. Start=0

Upon completion, the sequencer must be brought from the "Completed" state once again into the "Idle" state by means of RESET=1 and then RESET=0.

Note:
This setting is required also for transferring setpoint values in automatic mode. Without setting this parameter the setpoint value will not be transferred and not activated in the sequencer.

All further options as well as a detailed description of this problem are available in the Online Help for SFC.

How do you configure an operator request in an SFC type?Go to beginning
Part number:

Instructions:
It might happen that a production sequence cannot run completely automatically. For example, it might be necessary for the operator to make a manual operation or acknowledge an action. The automated sequence is to be continued only when the operator has done the work or acknowledged the operator request.

The following table describes how you configure an operator request in an SFC type. The operator request is displayed as follows during Runtime:

  1. As note text in the picture block of the SFC type instance.
  2. As a message in the WinCC Alarm Control.
  3. As a group display in the process picture, overview area and navigation window.
No. Procedure
1 Display note text in the picture block of the SFC type instance
The SFC type provides "Note texts" as a characteristic. You can use the Note texts characteristic to define different texts in an SFC type. Each note text is assigned a unique number, a name and a comment. Only one note text can be active at any one time. In order to activate a note text in a specific step, you must set the "OPTIPNO" signal to the value of the desired note text.


Fig. 01

The active note text is then displayed in the picture block of the SFC type instance. If you assign a comment to a note text, then the comment is displayed as a note text, otherwise the name is displayed as a note text.


Fig. 02

On the right of the note text is a button for acknowledging. If the operator acknowledges the note text with this button, the "OPTIPNO" signal is reset to the value "0". This information can be used as a stepping condition in a transition of the SFC type. The following figure shows the configuration of a transition. The transition steps to the next step if the operator request has been acknowledged.


Fig. 03

Notes:

  • The "OPTIPNO" signal is an output signal of the SFC block. The "OPTIPNO" signal can also be reset by direct assignment of the value "0" when processing a step. Acknowledgment of the note text does not necessarily have to be in the picture block of the SFC type instance.
  • Make sure that you configure the note texts in the language that is also to be displayed at Runtime. Language switchover for note texts is not supported.
2 Display a message in the WinCC Alarm Control
An SFC type instance consists of an ALARM_8P block (SFB 35) for configuring messages that require acknowledgement and two NOTIFY_8P blocks (SFB 31)  for configuring messages that do not require acknowledgement. Some messages of these blocks are already used by the system. You can fuse up to 7 messages that require acknowledgement on the ALARM_8P block and 5 messages that do not require acknowledgement on the second NOTIFY_8P block. In order to trigger a message in a specific step of the sequencer, you can set a message-triggering signal in a step. An external interconnection of the message-triggering signal in the CFC is not necessary. Below is a list of the available message signals of the message blocks:
 
Signal Message block Message signal
SIG2 MSG_EVID 
(ALARM_8P block)
SIG2
SIG3 SIG3
SIG4 SIG4
SIG5 SIG5
SIG6 SIG6
SIG7 SIG7
SIG8 SIG8
NSIG_12 NMSG_EVID2 
(second
NOTIFY_8P block)
SIG4
NSIG_13 SIG5
NSIG_14 SIG6
NSIG_15 SIG7
NSIG_16 SIG8

The following figure shows the configuration of a message that does not require acknowledgement where the "NSIG_16" signal is used.


Fig. 04

When the step is left, the message-triggering signal "NSIG_16" is reset.


Fig. 05

You must configure the additional message of the SFC type. For this you select the menu command "SFC > Message..." in the SFC editor. The "PCS7 Message Configuration" dialog opens. Here you can define the message properties (Message class, Event, ...). The following figure shows the configuration of the "NSIG_16" message that does not require acknowledgement.


Fig. 06

The message can only be displayed during WinCC Runtime in the WinCC Alarm Control or in the Batch Control Center in the Message Window. The following figure shows the message display in the Batch Control Center.


Fig. 07

3 Display a group display in the process picture, overview area and navigator window
The presence of an operator request can only be displayed during WinCC Runtime by a group display in the process picture, navigation window and in the overview area. During OS compilation the "Create/Update Block Icons..." function for the instance of the SFC type incorporates a block icon for the SFC in the process picture and interconnects it. The block icon for the SFC type contains a group display. For the information of the group display to be transferred to the overview area at Runtime, the property "CollectValue" must be connected directly with the "*.EventState" variable (dynamized) and the property "Relevant" must have the static value "Yes". This work is done by the "Create/Update Block Icons..." function. The process picture with the block icon for the SFC type instance must be incorporated in the Picture Tree Manager. The following picture shows an operator request of an SFC type instance at WinCC Runtime.


Fig. 08

Notes on the configuration of the group display are available:

  • In the WinCC Information System under "Options > Options for Process Control > Process Control Runtime > Group Display".
  • In the Help for PCS 7 under "PCS 7 - Configuration Manual Operator Station > Creating Process Images - Basics > Configuring a group display".
  • In Entry ID 493670.

Keywords:
Recipes, SFC

How do you proceed when there is a failure upon opening an SFC chart or SFC type in the SIMATIC Manager?Go to beginning
Part number:

Instructions:
If SIMATIC PCS 7 V6.1 SP1 is used with SIMATIC Logon V1.4, the following behavior might occur. If you attempt to open an SFC chart or SFC type in the SIMATIC Manager, there is a failure. The SFC editor appears just briefly and then disappears again. In this case you should contact the Technical Support specialists. The contacts are given in the entry at
http://support.automation.siemens.com/WW/view/en/16605034.

Note:
SIMATIC PCS 7 V6.1 SP1 are supplied by default with SIMATIC Logon V1.2 SP1. It is recommended to use software components that are included on the PCS 7 CD/DVD supplied.

How do you optimize the size of the work memory for an SFC type?Go to beginning
Part number:

Instructions:
When the S7 program is compiled, a function block (FB) is created for every SFC type. This FB is automatically allocated a number when an SFC type is created. This number can be set in the "Properties SFC type" dialog box. This FB calls two FCs internally, one for processing actions and the other for processing transitions. In the case of extensive step sequences, a block which is involved in the step sequence may exceed the work memory's 64 Kbyte limit. Should this occur, the S7 program cannot be successfully compiled. This entry describes options for optimizing the size of the work memory requirement for an SFC type without exceeding the 64 Kbyte limit of the work memory. Entry ID 24411054 describes how to determine the work memory requirement for an SFC type.
 
No. Description
1 Exporting instructions from the transition conditions to the CFC
This technique is aimed at reducing the FC work memory requirement for processing transitions.
Logic operation conditions, which occur repeatedly in transition conditions, can be configured in the CFC. Only the result of the logic operation is passed on to the SFC type as a process value and used in the relevant transitions.

Notes:

  • The potential for savings is greater, the more logic you export to the CFC and the more frequently the result of the logic operation is used within the SFC type.
  • The disadvantage in this method is that only the RLO appears within the SFC visualization in runtime because the actual logic is implemented in the CFC. However, if the CFC logic is created using HMI blocks (such as an INTERLOK block), the logic can be displayed and diagnosed in runtime via an appropriate faceplate.
2 Exporting instructions for processing actions to the CFC
This technique is aimed at reducing the FC work memory requirement for processing actions.
If many actuators (e.g. valves or pumps) have to be activated in the individual steps of an SFC type, the actuators can be combined in suitable groups and activated via shared modify values.

Notes:

  • The potential for savings is greater, the more individual signals there are combined as shared signals and the more frequently they are used.
  • The disadvantage of this technique is that additional logic is required in the CFC for actual actuator control.
    Example:
    It would be conceivable in extreme cases to output only the current step numbers or corresponding binary control signals as so-called "step flags" in the steps of an SFC type. Additional logic is required in the CFC for evaluating the SFC output signals and for actuator control. However, in that case the SFC visualization will not provide any direct indication in runtime of which actuators are controlled in which steps.
3 Data access on the basis of bits, bytes, words or double words
Under certain circumstances the number of instructions in the sequence of steps can be reduced if many bit-based data access actions are replaced by a few word-based data access actions.
4 Using loops
If the task involves executing certain steps one after another repeatedly, it may make sense to use the "loop" SFC element.
This enables a section of a sequence of steps to be performed repeatedly. This saves a great amount of program code. However, a disadvantage of this could be that the program may become less clear as soon as minor program changes have to be configured for individual executed loops.


Fig. 01

5 Combining alternative branches
If several alternative branches possess identical or similar structures, the steps of the various alternative branches can be run as a shared part of the program. The alternative branches will continue to be executed at the start of the sequence of steps. However, in order to allow for the differences between the original alternative steps, you will only receive one or a few steps, where only initialization measures will be performed. Depending on which initialization branch (alternative branch) has been performed at the start of the sequence of steps, different actions are performed in the shared part of the program.


Fig. 02

6 Splitting the plant functionality between several SFCs
The plant functionality of an extensive sequence of steps can be split between several sequences of steps. A main sequence of steps could call or control one or more secondary sequences of steps.

How do you determine the size of the work memory which is occupied by an SFC type?Go to beginning
Part number:

Instructions:
In the case of extensive sequences of steps, it is important to know how much work memory (code memory) an SFC type occupies. If the work memory for an SFC type exceeds the 64 Kbyte limit, the S7 program cannot be successfully compiled. This entry describes how to determine the work memory requirement for an SFC type.

When the S7 program is compiled, a function block (FB) is created for every SFC type. This FB is automatically allocated a number when an SFC type is created. This number can be set in the "Properties SFC type" dialog box.


Bild 01

This FB calls two FCs internally, one for processing actions and the other for processing transitions. The numbers of these FCs can be determined on the basis of the chart reference data. You can then read the size of the blocks in the work memory in Component View mode in the SIMATIC Manager. The procedure is as follows.
 
No. Procedure
1 Determining the number of the action and transition block
Open the SFC type using the SFC editor. In the SIMATIC Manager you execute the menu command "Options > Chart Reference Data". The "Chart Ref: display chart reference data" window opens. Select the menu command "View > S7 Resource Occupation". Sort the data shown on the basis of the "Configured object" column. Do this by clicking the header of the "Configured object" column. Look through the list of data displayed for lines containing the name of the SFC type in the "Configured object" column. Since the list of results is sorted on the basis of the "Configured object" column, all the blocks for a particular SFC type are displayed together. In addition to the block number for the actual sequence FBs, the display also includes the block numbers of the FCs for processing actions and transitions.


Bild 02

2 Determining the size of the block in the SIMATIC Manager
Switch to Component View mode in the SIMATIC Manager. Switch to the "Blocks" tab. The size of the blocks, which was determined in Step 1, can be defined in the "Details" view. This information is available in the "Size of the main memory" column.


Bild 03

How do you leave one SFC sequencer and continue processing in another sequencer at a fixed target position?Go to beginning
Part number:

 
Instructions:
Use the "SFC-Chart".TARGETSEQ and "SFC-Chart".TARGETSTEP connections in order to switch from one SFC sequencer and continue the sequence in another SFC sequencer.
"SFC-Chart".TARGETSEQ is the number of the sequencer to which you wish to switch. You can find the number in the properties dialog box for the sequencer under "Edit > Sequencer Properties".


Fig. 01

"SFC-Chart".TARGETSTEP is the number of the step to which you wish to switch. You can find the number in the step properties. Right-click the target step to open the properties dialog box.


Fig. 02

In the target step dialog box you can check the sequencer and step which were active most recently with "SFC-Chart".LASTSEQ or "SFC-Chart".LASTSTEP in order to set different target steps, for example.

During configuration, use the assignments TARGETSTEP and TARGETSEQ when processing the step, for example, as a way of indicating where you wish to switch to.


Fig. 03

Note:
The TARGETSEQ and TARGETSTEP parameters are not used to "jump" to another sequencer. The parameters enable you to process this sequencer later on by defining the step (TARGET STEP) from which you wish to start processing the sequencer. The sequencer is activated in accordance with the operating status logic of the SFC, e.g. by executing the corresponding command, not by setting TARGETSEQ.

You can find further information in the Online Help for the SFC under "SFC - Sequential Function Chart > Runtime controls in the PLC > Processing an SFC".

How can you monitor an SFC type "online" (in test mode)?Go to beginning
Part number:

Instructions:
Only the instance of an SFC type can be monitored "online" (in test mode).
 
No. Procedure
1 Open the CFC chart in which the SFC type whose instance you wish to test is integrated.
2 Right-click the block header of the integrated SFC block.


Fig. 01

The block's pop-up menu opens.


Fig. 02

Select the menu item "Open".

Note:
Double-click on a free area of the SFC block (see figure) to open the SFC chart also for monitoring.


Fig. 03

3 The SFC chart opens for monitoring. Switch on test mode with the button. Now you get both the required online information and a number of operator functions for the selected instance of the SFC type.


Fig. 04


What operating modes does the SFC have and what options are available for configuring sequencers?Go to beginning
Part number:

Instructions
A detailed description of the operating modes is available in the manual "SFC manual for S7", section 3.3. This manual is part of the package of documentation to accompany PCS 7.

The operating modes of the SFC-BZL (operating mode logic for SFC) are represented by the associated outputs on the SFC block.


Fig. 01
 

External signals can be interconnected via inputs on the SFC in order to force transitions between the operating modes of the SFC-BZL based ob the occurrence of specific process events (locks).


Fig. 02
 

For example, the input "LOCKERROR=1" forces a change to operating mode "Error" or "Error (completing)". The output "ERROR=1" or "ERROR_COMPLETING=1" is set as long as the error is present ("LOCKERROR=1") and error processing has been fully completed. When the error condition disappears ("LOCKERROR=0"), the SFC goes into operating mode "Held (error)" ("HELD_ERROR=1"). If there is an error, it immediatly switches back to the operating mode "Error" ("ERROR=1").

Troubleshooting examples through configuring an additional sequencer:
 
  Example
a) Troubleshooting without change of operating mode
For the start condition you can also check any process status. You interconnect it with the external signal "LOCKERROR" (SFC input). The SFC goes into the operating mode "Error" ("ERROR=1") if there is an error.
Additionally configure a sequencer for troubleshooting whose start condition is, for example, "ERROR=1" AND "Process status=1".
b) Troubleshooting with change of operating mode
Configure a sequencer with the start condition"Process status=1" and assign it high priority.
Then this sequencer is always executed when there is an error and the sequencer just processed has a lower priority than the sequencer for troubleshooting. In this case you don't interconnect the process status with the input "LOCKERROR", otherwise there would be a change to the operating mode "Error".

More examples of change to error operating mode in the SFC-B:
 
  Example
1. Which signals cause a change to be made to the operating mode "ERROR"?
TA transition to the operating mode "ERROR" in the operating mode logic is triggered by setting the input "LOCKERROR" in the operating mode types "HAND" or "AUTO" or in the SFC test mode in the operating mode type "HAND" by operating the "Error" button.
If the current operating mode is "STARTING"; "RUN"; "CONTINUING" or "STOPPED", a change is made to the operating mode "ERROR" when "LOCKERROR=1".
2. Which signals cause a change to be made to the operating mode "ERROR_COMPLETING"?
Transition to the operating mode "ERROR_COMPLETING" in the operating mode logic is triggered by setting the input "LOCKERROR" in the operating mode types "HAND" or "AUTO" or in the SFC test mode in the operating mode type "HAND" by operating the "Error" button.
If the current operating mode is "COMPLETING", a change is made to the operating mode "ERROR_COMPLETING" when "LOCKERROR=1".
3. Which signals must not be present so that the operating mode "ERROR_COMPLETING" can be completed?
The condition "LOCKERROR =0" must be fulfilled and there processing of any sequencer configured in "ERROR_COMPLETING" must also be completed.
4. How do you achieve the operating mode "HELD_ERROR"?
The condition "LOCKERROR =0" must be fulfilled and thr processing of any sequencer configured in "ERROR" must also be completed.

It is also possible, for example, to configure separate sequencers as start conditions for troubleshooting via the signals "ERROR=1" and  "ERROR_COMPLETING=1".


How can you display the current operational status of a sequencer?Go to beginning
Part number:

Instructions:
The following table describes the various options for displaying the current operational status of a sequencer (SFC type) on the OS. The display methods are described briefly and statements made about the following properties:

  • Support of multiple languages
    It is indicated whether the display method supports language switchover during Runtime.
  • Display of parallel branches
    It is indicated whether the display method supports the running of parallel branches.
  • Group display of multiple steps
    It is indicated whether the display method supports group display of multiple steps. It is possible here to have a simplified display of the sequence.
  • Message in WinCC Alarm Logging
    It is indicated whether the display method saves the operational statuses as messages in WinCC Alarm Logging.

The display options offered by default in PCS 7 are given in the manual "PCS 7 SFC Visualization".
 
No. Option
1 SFC visualization
The SFC visualization is used to display the configured steps of a sequencer in a picture window during Runtime. The active steps are marked in color (green by default). The following two display methods are available: The Overview display shows all the configured steps and transitions without labeling. The Overview display is a space-saving display method. The following figure shows the Overview display.


Fig. 01

The Detailed display shows all the configured steps and transitions with labeling. When you select a step or transition in the Detailed display, additional information is displayed. The following figure shows the Detailed display.


Fig. 02

 
Support of multiple languages: no
Display of parallel branches: yes
Group display of multiple steps: no
Message in WinCC Alarm Logging: no

2 Note and position texts
The SFC type provides the characteristic "Note texts" and "Position texts". These texts can be displayed during Runtime in the picture block of the SFC type instance or in the picture windows of the SFC visualization. The following figure shows the display of a note or position text. Only one note or position text can be active at any one time. For this reason, these texts are not suitable for displaying sequences with parallel structures.


Fig. 03

Notes on the configuration of the note and position texts are available:

  • In the Programming and Operating Manual "PCS 7 - SFC for SIMATIC S7"
  • In Entry ID 28284626
Support of multiple languages: no
Display of parallel branches: no
Group display of multiple steps: yes
Message in WinCC Alarm Logging: no
3 Operator message via message block of own SFC type instance
An SFC type provides different message signals to generate messages in WinCC Alarm Logging. Entry 28284626 describes which message signals are available for use with an SFC type. During the processing of a step (Initialization, Processing, Termination), message signals can be set and reset directly. If a message signal is set, the associated message is triggered. In this way, messages can be triggered in specific steps of a sequencer, whereby the message text contains information on the current operational status of a sequencer (e.g. step designation).

Notes:

  • Setting/resetting the message signal
    You can only configure setting/resetting of the message signal in the SFC editor. It is not necessary to output the message signal as a control value (SFC output) and then interconnect it in the CFC.
  • Configuring a message text
    You can configure the information on the operational status in different ways in a message text:
    • Message text without process-associated values
      You can configure the message texts in the dialog "PCS 7 Message Configuration". You can configure the message texts in multiple languages in this dialog. However, you need a separate message for each operational status of the sequencer to be displayed. But the number of message signals available in an SFC type is greatly restricted (7 messages requiring acknowledgment, 5 messages not requiring acknowledgment). Therefore, you should rarely use this method.

      Entry 28284626 uses this procedure to trigger a message for an operator request.
       
    • Message text with process-associated values
      You can configure the message texts in the dialog "PCS 7 Message Configuration", whereby the actual information on the operational status is displayed in the message text as a process-associated value. For this purpose, an output (control value) of the "STRING" data type, which contains the information on the operational status (e.g. step designation), is created in the SFC type. While a step of the sequencer is being processed this control value is written with the text for the step and made available at the output of the SFC. In the CFC, the signal of the "STRING" data type is converted into the "Array of bytes" data type and then interconnected with the message-associated value of the SFC block. It is necessary to convert the signal from the "STRING" data type to the "Array of bytes" data type, because signals of the "SIGNAL" data type cannot be interconnected as message-associated values.
      Multiple language configuration is not possible by default with this method.

      Entry ID 28883644 shows this procedure.
Support of multiple languages: yes
(number of operational statuses to be displayed restricted by the number of message signals available)
Display of parallel branches: yes
(number of parallel branches to be displayed restricted by the number of message signals available)
Group display of multiple steps: yes
Message in WinCC Alarm Logging: yes
4 Operator message with separate message-compatible block
This principle is similar to the procedure described in Point 3 "Operator message via message block of own SFC type instance". However, in this method the messages are not generated with message blocks of the own SFC type instance, but with a separate message-compatible block.

Entry ID 19687231 describes how to create and interconnect a separate message-compatible block.
 
Support of multiple languages: yes
(number of operational statuses to be displayed restricted by the number of message blocks used)
Display of parallel branches: yes
(number of parallel branches to be displayed restricted by the number of message blocks used)
Group display of multiple steps: yes
Message in WinCC Alarm Logging: yes

5

Transfer and display operational status in the OS via numeric variable
You can configure a control value as output in the SFC to display the operational status of a sequencer. A numerical value is assigned to this control variable in the steps of the sequencer. The attribute "S7_m_c=true" is assigned to this control value in the SFC configuration. In this way, the information of the control variable is transferred to the OS. Each numerical value corresponds to an operational status of the sequencer. There are different ways of displaying. A few of the options are listed below.

  • Using the WinCC status display
    The operational status can be displayed using the WinCC status display. If no texts are used in the picture files of the status display, then this display method is language independent.
  • Managing enumeration texts in the SIMATIC Manager (under Shared Declarations)
    In the SIMATIC Manager, under "Shared Declarations > Enumerations" an enumeration type is created and a text entry is generated for each operational status to be displayed. Multiple language configuration is possible. The texts configured in this way in the SIMATIC Manager can be transferred to WinCC with OS compilation and displayed during Runtime.
    Entry ID 27147567 describes this procedure.
  • Managing enumeration texts in the WinCC Text Library
    The enumeration texts for describing the different operational statuses of a sequencer can also be configured manually in the WinCC Text Library. Multiple language configuration is possible. A number range is reserved in the Text Library for the text IDs of these texts. The display texts of the different operational statuses are created in this number range according to the associated numerical values. Once the initial number of the reserved number range and the numerical value of the current operational status are known, the associated text can be read out of the Text Library and displayed during Runtime.
    Entry ID 23416727 describes how can you reserve ranges in the WinCC Text Library.
Support of multiple languages: yes
Display of parallel branches: yes
Group display of multiple steps: yes
Message in WinCC Alarm Logging: no

Keywords:
Close-up, SFC control, SFC MultiChartControl

How can you display the operational display of a sequencer with a message of the SFC type instance?Go to beginning
Part number:

Instructions:
Entry ID 28883565 describes the various options for displaying the current operational status of a sequencer on an OS. This entry describes one option where the operational status is displayed as a message text in a message. Here, the message is generated directly by one of the message blocks of the SFC type instance. A message-associated value is used to display the actual operational status of the sequencer in the message text. For this, in the separate steps of the SFC type, the text with the operational status is written to a specially created output (control value) of the STRING data type. In the CFC, this text is converted in a self-created block into a structure that contains the text as the data type "ARRAY OF BYTES". This structure is then interconnected with a message-associated value of the SFC type instance. In principle, a message of the SFC type could be generated, in which the available message signals of an SFC type are set/reset directly in the separate steps. Entry ID 28284626 gives an overview of which message signals are available for use with an SFC type. In this example, however, the messages are not triggered directly in the separate steps of the SFC type, but the message signals are output like the texts as control values. The message signals are interconnected in the CFC with the user-created block. In this block, the message signal is output "1:1" at the output and then interconnected with the signal input of a message of the SFC block. This ensures that the correct text is available as a message-associated value at the time a message is triggered.

In this way, the operational statuses of a sequencer are displayed as messages in the WinCC message system, in the alarm view of the of the SFC picture block and in the BATCH batch log.
  
No. Procedure
1 Configuring the SFC type
  • Define SFC control values (output parameters)
    In the SFC type, you create the necessary number of output parameters (control values) to be able to parameterize the actual message text in the separate steps of the sequencer. Depending on the structure of the sequencer (e.g. if it has parallel branches), multiple message texts might be necessary. In this example we have created 5 text variables (STRING) as control variables. Since the sequencer in this example has a parallel branch, 2 text variables would be sufficient for the display. The remaining signals are in reserve.
  • Write SFC control values (output parameters) to the steps
    Assign values to the text variables (control values) of the sequencer in the actions for step processing, for example:
    • Initialization of a step
      When you initialize a step you can reset the message-triggering signal (FALSE), for example. At this point, do not yet set the actual text for the operational status.

      Background:
      Resetting of the message-triggering signal is important! On the one hand, during Runtime, this generates a "Went out" message for a message requiring acknowledgement already present. On the other, a new message is only triggered when the message-triggering signal has a positive edge.
       
    • Processing a step
      When processing a step you can set the message-triggering signal (TRUE) and at the same time set the text for the current operational status.

      Background:
      This generates a "came in" message. The current operational status is displayed in the message text.

The following figure gives an example of this procedure.


Fig. 01

Note:
Note that a change of the message-triggering signal (positive edge) must be output to trigger a message. If a reset is made when a step is completed and a set is made when the next step is initialized, the message-triggering signal (output parameter) is not changed.

2 Create a block for data type change
The message-associated values cannot be interconnected directly with the text variables configured in "Step 1". Below, an SCL source is available for downloading, with which you can create a block that reads in a signal of the "STRING32" data type as an input signal and makes the data available again at the output as a structure with 32 bytes. You can interconnect this output signal with the process-associated values.

  string2array_scl.pdf ( 9 KB )

The following download provides the source as a text file. You can open the text files with Notepad.exe, for example, copy the source code and then insert this in the SCL editor. You must assign a block number to ensure that the source can be compiled correctly. For this, you can make an entry in the symbol table.

string2array.zip ( 5 KB )

3 Configure SFC messages
Select the menu command "SFC > Message..." in the SFC editor. The "PCS7 Message Configuration" dialog opens. Here you can define the message properties (Message class, Event, ...). The following figure shows the configuration of the messages requiring acknowledgment "SIG_2" and "SIG_3".


Fig. 02

4 Interconnect blocks in the CFC
Interconnect the sequencer block with the block for changing the data type.


Fig. 03

5 Compile/Download/Test
Compile and download the AS and the OS.

During Runtime, the operational statuses are displayed in the WinCC message system, in the alarm view of the of the SFC picture block and in the BATCH batch log. The following figure shows the complete alarm view of the of the SFC picture block.


Fig. 04

The following figure shows an excerpt of the BATCH batch log.


Fig. 05

How can pre- and afterprocessing be used in the sequence features of the SFC at SIMATIC PCS 7 V6?Go to beginning
Part number:

Description:  
For all sequences an action can be configured. The action consists of a share, which will be executed before the cyclic sequences processing (preprocessing) and an share, which will be executed after the cylclic sequence processing (afterprocessing). Both shares can be configured in the dialog field "Sequence properties". Next to the tab “Startconditions“, the dialogbox contains the register "Preprocessing" and "Afterprocessing", their built up corresponds to the processing period of steps. This applies for both SFC-types and for SFC-charts.


Fig. 1: Dialogbox sequence properties with register for pre- and afterprocessing

The object properties (general, Startconditions, OS- comment, preprocessing, afterprocessing) can be configured for each sequence . The dialogbox will be opened by positioning the mouse pointer on the register of the sequence, right-clicking and choosing "sequenceproperties..." from the menu; or alternatively : double-click on the register or rather via the menu bar "Edit > sequence properties...".

Example: 
Let's take that in a CFC sequence, three blocks, followed by a SFC-Chart, and finally an additional block are embedded  in OB35.  
If  the pre- and/or postprocessing is configured in the sequence properties of at least one sequence of the SFC-Chart, the following happens: 
In each scan cycle of the OB35,  all of the 3 blocks will first be processed one after the other - then the preprocessing of the respective active sequence will be executed. Follows the scan cycle part of the SFC-Chart. Finally comes the postprocessing, right before the next block of the sequence order get processed.

Each sequence of the SFC-plan or SFC-type has its own cyclic pre- and afterprocessing. Since only one sequence of a SFC-plan or a SFC-type can be active at the time, only this pre- and afterprocessing can be processed. Per AS-cyclic (according to OB), only one pre- and afterprocessing application takes place. Settings made during the afterprocessing, can only be backed up in the next AS-scan cycle by the SFC.

More information can be found in the online help and the Simatic documentation manual "SFC- manual for S7", which is as well on the SIMATIC PCS 7 Docu CD.

When do I use a SFC-Chart and when a SFC-Type in SIMATIC PCS 7?Go to beginning
Part number:

Description
With SFC V6.0, the Type/ Instance Concept  was introduced in SIMATIC PCS 7. It is therefore possible, to create types of sequential control systems which create SFC-Instances once placed in a CFC-Chart.

A SFC-Chart is allocated to a specific CPU and is also completely processed there. There might exist instances in several CPUs regarding a SFC-Type located in a master data library .

In the SFC-Editor , you have the object type "SFC-Chart" but also the object type "SFC-Type". The SFC-Type enables the definition of sequential control systems including an Interface, and requires that definition before using the CFC-Chart. The sequential logic of the SFC-Type is exclusively based on the Interface-connections of the SFC-Type, i.e. the SFC-Type, unlike to the SFC-Chart, cannot get access to certain process signals. The SFC-Type cannot be executed on its own, instances have always to be placed within CFC.  You can configure for a SFC-Type: seven messages to be achnowledged and five messages which do not have to be acknowledged. Within one SFC-Type, 32 sequences can be configured.

Fig. 1: Display and use of the SFC-Type in SIMATIC PCS 7

The SFC-Chart has a Standard-Interface (derived from the Interface of the Runtime system). This interface cannot be modified i.e. no connectors can be removed, added or renamed. For a SFC-Chart seven messages to be acknowledged can be configured. Within a SFC-Chart 8 sequences can be configured.

Basically - apart from the above-mentioned properties- the following can be pointed out:

  • If you need to configure a sequential function  in a PCS 7 project for only one use, the use of a SFC-Plan is recommended. It is possible to configure immediately with the connectors already existing in the project - whereas for the SFC-Type an Interface has to be created first.  
  • If you need the same sequential functionality at least twice or more, the use of the SFC-Type is recommended. The slightly higher efforts are more than compensated by instance ability and changeability.  

How do you visualize the current runtime of a step of an SFC sequence?Go to beginning
Part number:

Description
The current step runtime can be displayed in PCS 7 through the SFC visualization in Runtime.


Fig. 1: Step runtime in the SFC visualization

If you intend to configure the step runtime in an I/O field in WinCC Runtime, for example, a corresponding tag is required inside the Tag Management of WinCC. Here, a distinction has to be made between the PCS 7 versions:

  • PCS 7 V5.x
    For PCS 7 V5.x there is no automatically created variable which can be used for the visualization. However, should this information be requested, it can be obtained, for example, by configuring a timer that would be started parallel to the step. 
  • PCS 7 V6 onwards
    For PCS 7 V6 onwards the variable is not created automatically either. When using the SFC type, it is possible to set the attribute "S7_m_c" to the value "true" for the "CUSTEPRT" variable in the interface of the block. Open the SFC type sequence, choose the menu item "View > Interfaces" and find the OUT variable "CUSTEPRT".


Fig. 2: Variable with current runtime step

Right-click Object Properties to open the Properties dialog of the variables and set the attribute S7_m_c.


Fig. 3: Add and set attribute S7_m_c

After OS compilation this variable is created in the Tag Management of WinCC and can be used for the visualization. However, this procedure is only valid for the new SFC type in PCS 7 V6 onwards and cannot be used for a previous SFC chart.

How do you configure an SFC type to ensure automatic interconnection of the block contacts?Go to beginning
Part number:

Description
If you want to implement the SFC type/instance concept, use the Properties dialog of the SFC editor to help with the configuring. The Properties dialog is used for the technological configuration of an SFC type. You can use the Properties dialog to add the connection types below to your interface of the SFC type.
 
Property Meaning
Operating mode Operating modes are for the process engineering-related structuring of an SFC type. Using the Properties dialog you can define operating modes so that they can be used in the sequences (heating, cooling, ... , for example).
Setpoint values Setpoint values are used to control the SFC type. These can be specified by operation or by a higher-level controller (BATCH flexible, for example).
Process values Process values are used to control the SFC-types on the basis of process signals (the value for the fill level, for example).
Control values Control values are used to control an external logic through the SFC type.
Parameter Parameters are used for instance-specific modification of the behavior of the SFC type.
Marker Markers are used for placing values in the clipboard. Markers are created as static variables that are invisible in the CFC interface presentation.
Times Time objects are used to configure time-controlled procedures in an SFC type. Time objects are realized by means of a standard time block (TIMER_P) that supports different modes (pulse, extended pulse, switch-on delay, latching switch-on delay, switch-off delay).
Note texts Operating/instruction notes are additional texts for display in the picture block. Here, text lines can be displayed that contain additional information for the user. Via an output at the interface, texts predefined in the Properties dialog can be displayed by setting the output in one step.
Block contacts Block contacts represent blocks of the basic automation. For this purpose, elements that can be used in the sequencers are defined in the interface of the SFC type.
Position texts Position texts are used to display the current position in the sequencers. A position text consists of a number and the assigned text. The text is displayed in an SFC faceplate instead of the step text. The number of the position can be evaluated by a higher-level controller (BATCH or SFC, for example). The position number is made up of separate steps. Various steps can be grouped in one number.

Table 1: Groups and their meanings in the Properties dialog

You open the Properties dialog in the SFC editor via the icon in the toolbar (1) or via the menu bar ("View > Properties").

 
Fig. 1: Settings in the Properties dialog

To insert a technological block you select the "Block contacts" option in the left pane. Then in the right pane you can assign any instance name (2) and the block (3) that you want to interconnect. It is important to note that at least one block (for example, MOTOR, VALVE, CTRL_PID, ...) has to be inserted in the CFC chart before the block instances can be displayed in the drop-down list box.
Once you have completed the configuration in the Properties dialog you can see the results of the contacts. For this you have the contacts displayed via the menu item "View > Connections".

 
Fig. 2: Interface variables

To define which inputs/outputs of a block are to be interconnected you can open a relevant block in the LAD/STL/FBD editor. There you can set the "S7_contact := 'true'" attribute for each input/output. If you do not need a connection of a block, set the value of the "S7_contact" to 'false'.
You can also use the "S7_contact" attribute for self-written blocks.

 
Fig. 3: Properties of the interface variable

On completion of configuration in the SFC editor, close the editor and now open the CFC chart which contains the block that you interconnected in the SFC editor. Here you insert your SFC type which you find in the block catalog under "Other Blocks".

 
Fig. 4: CFC block before automatic interconnection

If, in the last step of the configuration, you first select a block contact at the SFC instance (*_LIOP_SEL, for example) and then click the synonymous connection of the technological block, all the inputs/outputs are interconnected between these two blocks.
If unintentional interconnections are made during the automatic interconnection, you can remove them again separately.

 
Fig. 5: Interconnected CFC blocks

How can you display the operational status of a sequencer with a message of a separate message-compatible block?Go to beginning
Part number:

Instructions:
Entry ID 28883565 describes the various options for displaying the current operational status of a sequencer on an OS. This entry describes one option where the operational status is displayed as a message text in a message. A message-associated value is used to display the actual operational status of the sequencer in the message text. For this, in the separate steps of the SFC type, the text for displaying the operational status is written to a specially created output (control value). This text (STRING) is interconnected in the CFC with the user-created block. To actually trigger the message, a binary output (BOOL) is set in the SFC type and connected in the CFC with the user-created message block.

Notes on choosing the solution:

  • The operational status of the sequencer ("STRING" data type) cannot be interconnected directly with the message-associated value of an alarm block (ALARM_8P or NOTIFY_8P) when configuring in the SFC type. This is why it is necessary to change the data type in the CFC from the "STRING" data type to another data type (ARRAY OF BYTE or STRUCT). In the solution described below, this change of data type is made by an additional block in the CFC. This additional block is also used to trigger the desired "operator message".
  • Alternatively, it is possible use the available message signals of the SFC type to trigger the actual "operator message". Consider adding a possible time delay if you set/reset the message-triggering signals directly in the CFC and interconnect the texts in the CFC. Entry ID 28883644 describes this solution in detail.
In this way, the operational statuses of a sequencer are displayed as messages in the WinCC message system and in the BATCH log. The messages generated in this way are not displayed by default in the Alarm view of the SFC faceplate, because only the messages of the associated block (instance DB) are displayed in a PCS 7 faceplate. In this case, these are only the messages that are triggered directly by the SFC type instance. Entry ID 28737155 describes how you can also have the messages displayed in the Alarm view of the PCS 7 faceplate.
 
No. Procedure
1 Configuring the SFC type
  • Define SFC control values (output parameters)
    In the SFC type, you create the necessary number of output parameters (control values) to be able to parameterize the message-triggering signal and the actual message text in the separate steps of the sequencer. Depending on the structure of the sequencer (e.g. if it has parallel branches), multiple message-triggering signals and message texts might be necessary. In this example, we have created 5 binary (BOOL) and 5 text variables (STRING) as control variables. Since the sequencer in this example has a parallel branch, 2 signals each would be sufficient. The remaining signals are in reserve.
     
  • Write SFC control values (output parameters)
    Assign values to the SFC control values of the sequencer in the actions for step processing, for example:
    • Initialization of a step
      When you initialize a step you can reset the message-triggering signal (FALSE), for example. At this point, do not yet set the actual text for the operational status.
      Background:
      Resetting the message-triggering signal can cause the message block to generate a "Went out" message at Runtime for a message requiring acknowledgement already present. However a new message can only be triggered when the message-triggering signal has a positive edge. That is why resetting is so important.
    • Processing a step
      When processing a step you can set the message-triggering signal (TRUE) and at the same time set the text for the current operational status.
      Background:
      This causes the message block to generate a "Came in" message at Runtime. The current operational status is displayed in the message text.

The following figure gives an example of this procedure.


Fig. 01

Note:
Note that a change of the message-triggering signal (positive edge) must be output to trigger a message. If a reset is made when a step is completed and a set is made when the next step is initialized, the message-triggering signal (output parameter) is not changed.

2 Create a message-compatible block
Information on creating message-compatible blocks is available
  • In the manual "Process Control System PCS 7 - Block Programming Instructions".
    This manual contains notes on the topics of "Configuring Messages" and "Connecting to SIMATIC BATCH".

Below an SCL source is available for downloading, which you can use to create a message-compatible block.

operate_scl.pdf ( 10 KB )

SCL is the preferred programming language for creating blocks in PCS 7. However, since it might be necessary to use STL as the language for creating a PCS 7 block, an STL source is also made available. Note that the behavior of the system function "BLKMOV" (SFC 20) used is different in SCL and STL.

operate_STL.pdf ( 11 KB )

The following download provides both sources as text files. You can open the text files with Notepad.exe, for example, copy the source code and then insert this in the relevant programming editor (SCL editor or AWL editor). You must assign a block number to ensure that the source can be compiled correctly. For this, you can make an entry in the symbol table.

operate.zip ( 16 KB )

Notes:

  • PCS 7 message dialog
    In the following steps, in order to obtain the PCS 7 message dialog when configuring the message texts, you must use the block attribute "S7_alarm_ui := '1'" in the block header.
     
  • Using BLKMOV (SFC 20)
    The step description is available as data type "STRING". However, data types of the "STRING" type cannot be transferred as message-associated values to the "ALARM_8P" block. That is why you have to change the type. The system function "BLKMOV" (SFC 20) is used to copy the variable of the "STRING" type into a variable that can be interconnected with the message-associated value.
    • SCL
      The system function BLKMOV is used in the SCL source to copy a variable of the data type "STRING" to a variable of the data type "ARRAY OF BYTE". The first two bytes of a variable of the STRING type contain information on the length of the character string (maximum total length and currently used length). If the source character string of the BLKMOV function is of the data type "STRING", in SCL, the first two bytes of the character string (length information) are not copied. The maximum number of characters is not copied, only the characters currently being used. The variable of the data type "ARRAY OF BYTE" is transferred as a message-associated value.
    • STL
      When using STL these first two bytes (length information) are copied. During OS Runtime this might lead to the display of unwanted characters in the message text. To prevent this, a structure of two elements is specified as the target of the copy procedure. The first structure element is an ARRAY of two bytes, which contains the length information. The second structure element is of the data type ARRAY OF BYTES, which contains the characters to be displayed. The appropriate number of bytes must be selected so that the complete character string can be copied. The whole structure is not transferred as message-associated value, only the second structure element.
       
  • BATCH connection parameters
    If the block is to be used in conjunction with SIMATIC BATCH, then the following parameters must be available: "BA_EN", "BA_NA", "BA_ID", "OCCUPIED" and "STEP_NO". The connection parameter "BA_NA" (STRING 32) is assigned to the first message-associated value, the connection parameter "STEP_NO" to the second message-associated value and the parameter "BA_ID" to the third message-associated value. This is important for having the messages displayed in the BATCH log. Entry ID 28468592 provides more information.
     
  • Continuous interconnection of the message-associated values
    The message-associated values needed in the message are parameterized on the associated connections "SD_1" to "SD_10" when the "ALARM_8P" block is called. Note that the message-associated values needed are used continuously by the first connection "SD_1". As soon as a connection for a message-associated value is not interconnected, the subsequently used message-associated values are not displayed in the message at Runtime.

    The message-associated values are interconnected as follows in this example:
    • SD_1:= abyBA_NA  (BATCH batch designation)
    • SD_2:= wSTEP_NO (BATCH step number)
    • SD_3:= dwBA_ID     (BATCH running batch number)
    • SD_4:= abyText1     (Text1 for operational status)
    • SD_5:= abyText2     (Text2 for operational status)
    • SD_6:= abyText3     (Text3 for operational status)
    • SD_7:= abyText4     (Text4 for operational status)
    • SD_8:= abyText5     (Text5 for operational status)

    More information is available in Entry ID 189296.
     

  • Delete and re-incorporate blocks
    If you change the structure of the message-compatible block, e.g. because you have added or deleted inputs or outputs, then you must execute the following actions to have the desired messages displayed in the OS at Runtime:
    • Update the block type.
    • Delete, re-incorporate and interconnect blocks of this type already incorporated in the CFC.
    • Do a complete compilation and download of the AS.
    • Do a complete compilation and download of the OS.

    More information is available in Entry ID 189296.

3 Configure messages of the message-compatible block
Once you have successfully compiled the block, you can configure the messages.
  • Switch to the Components view of SIMATIC Manager.
  • Select the "Blocks" folder of the controller program concerned in the tree view.
  • In the working area select the pop-up menu of the block created.
  • Select the item "Special Object Properties > Message...". The "PCS 7 Message Configuration" dialog opens.
  • Select the desired message class and parameterize the message texts.


    Fig. 02
4 Interconnect blocks in the CFC
Interconnect the sequencer block with the separate message block.


Fig. 03

5 Compile/Download/Test
  • Do a complete compilation and complete download of the AS.
  • Do a complete compilation and complete download of the OS.
  • Now you can test the function. The following figure shows the messages in the Alarm view of the SFC faceplate. Please also note the necessary changes as given in Entry ID 28737155.


    Fig. 04

    The following figure shows an excerpt of the BATCH log.


    Fig. 05

How can you resume a SFC sequence at the point of abortion upon restart of the CPU?Go to beginning
Part number:

Description

Valid as from SIMATIC PCS 7 V5.2
If an SFC sequencer is interrupted by a power failure or a CPU STOP, the sequence cannot be continued from where it was interrupted. The sequencer will resume processing again from the initial step after the restart.
However, if a different behavior is required for the restart, this logic must be configured in the SFC chart and then the SFC sequencer must be inserted in OB100. Jumps to defined poke points after the initial step are inserted in the SFC. In the jump transitions, the global tag with the current poke point is queried. In the steps that are also poke points, a global tag is written with the current poke point.

Note
However, it is possible to jump manually (with Test mode activated on the Engineering Station) to a certain step (target step) to start the sequence from that point. The "Target step" option can be set in the object properties of the respective step (Fig. 1).


Fig. 1: Object properties of a step in the SFC chart - Defining the Target step

Generally, this behavior should not occur because the CPU must not go into STOP due to a power failure, for example. We therefore recommend using a UPS (uninterruptible power supply), which prevents this failure scenario occurring and avoids costly plant shutdowns due to power failure.

How do you switch an SFC chart into automatic mode?Go to beginning
Part number:

Description

SIMATIC PCS 7 V5.x
You can use the SFC_CTRL block to switch an SFC chart from automatic to manual mode in the CFC program.

However, for safety reasons it is only possible to switch into automatic mode with the SFC_CTRL block once you have enabled the switchover to automatic mode manually in SFC visualization. It is also possible to switch from manual mode to automatic mode in the test mode of the Engineering Station.

For information on which inputs must be interconnected in order to switch modes and other information on using the "SFC_CTRL" block, please refer to Entry ID: 790830 "Use of the SFC Control Block in PCS 7 V4.0x and V5.x".

SIMATIC PCS 7 V6.x
As from SIMATIC PCS 7 version V6 you can switch modes from MANUAL to AUTO via the external view. This also applies to the SFC type / instance.

Additional information can be found in the SFC online help or in the manual "SIMATIC SFC for S7 Sequential Function Chart V6.0" in Entry ID: 15240136.

Keywords
Control block, Operating mode

What should you watch out for when doing a delta download of an SFC chart?Go to beginning
Part number:

Description
Delta download of an SFC chart with SIMATIC PCS 7 V5.2
If you attempt to download an SFC chart into the PLC with a delta download while the SFC chart in question is in use, the procedure is interrupted with the error message below.

"SFC xy cannot be loaded. It is not in the "OFF" mode. Before downloading execute the commands "Stop" and "Cancel"."

If the topology of the SFC chart was changed (new steps or transitions added or the sequence altered), the target of a jump transition changed or the SFC deleted, the download procedure is interrupted in order to avoid inconsistencies. This means that no CFC charts or blocks are downloaded. SFC charts affected by a change in topology may not be in use before or during the delta download.

Delta downloading - without switching off the active chart first - is only possible if you only changed the configuration of an existing step (name, comment, OS comment, attributes, assignments) or of an existing transition (name, comment, conditions, OS comments).

Delta download of an SFC chart with SIMATIC PCS 7 V6.0
If the topology is changed on active SFC charts (new steps/transitions added or the sequence altered), the target of a jump transition changed or the SFC deleted, these are switched off by system queries.
The objects affected are displayed in the list, but you cannot select them here. However, you can cancel the dialog if you do not want to switch off the SFC charts/instances at the moment. The download procedure is then also aborted. A maximum waiting period in which the SFC must be disabled is set by default, but you can change it if you want.


Fig. 1: Disabling active SFC charts/instances during SFC downloading

If you get the message that the SFC could not be disabled, you can increase the waiting time. If increasing the time does not have the desired result, because the SFC is engaged in a logic mode that cannot be quit at the time, you must cancel the download, disable the SFC manually at the appropriate moment and then do the download.

The SFCs listed here were active before the download procedure and can now be reenabled. To do this, select the objects to be reenabled. Note here that you are responsible for starting the SFC charts/instances. Take into account here the sequence control systems that possibly are not to be started manually but in AUTO mode (e.g. from a CFC chart).


Fig. 2: Reenabling the SFC charts/instances during the download procedure

Note:
More information on downloading SFC charts is available in the PCS 7 Online Help under "Configuration - Engineering System > Configuring the PCS 7 > Configuring AS Functions > Creating Sequential Control Systems (SFC) > How to Download SFC Charts to the CPU" (this link refers to the Online Help of PCS 7 V7.1 SP3).

Keywords:
Configuration changes

How do you expand user created blocks or standard blocks from the PCS 7 library so that they are listed in the Properties dialog of the SFC editor?Go to beginning
Part number:

Description
In order to list user created blocks or standard blocks from the PCS 7 library in the Properties dialog of the SFC editor, the respective interfaces of the block must be expanded by the system attribute "S7_contact". 

Proceed as follows:

  1. Open your block or the block from the PCS 7 standard library by double-clicking the block in the LAD/STL/FBD editor. 

    Note 
    Do not change standard blocks in the PCS 7 library. Copy the blocks to be modified into the master data library of your PCS 7 project.

  2. Then, in the LAD/STL/FBD editor, open the Properties dialog of the connection to be modified by right-clicking and selecting "Object Properties".


Fig. 1: View in the LAD/STL/FBD editor for modifying connection attributes

  1. In the Properties dialog you then select the PCS 7 system attribute "S7_contact" and set the variable value to "true".
  2. If necessary, make additional changes to other block connections.
  3. Finally, save the block in the LAD/STL/FBD editor and close the editor.
  4. Update the changed block in the CFC. Go to "Tools > Block types" in the CFC. Here you select the modified block and press the "New version" button. Confirm "Import new version..." with "YES" so that the changes of your configured blocks take effect.

Note
More information on the topic of block contacts is available in the PCS 7 Online Help under
"Configuration - Engineering System > Configuring the PCS 7 > Configuring PLC Functions > Creating Sequential Control Systems (SFC) > How to create an SFC type and > How to create an SFC instance".

 Entry ID:22971603   Date:2011-09-12 
I regard this article....as helpfulas not helpful                                 






























mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Topics
Help
Online Help
Guided Tour