graph7

12
show the entry list S7 S7 S7 S7-GRAPH GRAPH GRAPH GRAPH -- -- -- -- Creating S7 programs Creating S7 programs Creating S7 programs Creating S7 programs -- -- -- -- Executing / monitoring steps and transitions Executing / monitoring steps and transitions Executing / monitoring steps and transitions Executing / monitoring steps and transitions Information about the topic of "Executing / monitoring steps and transitions" What tips and tricks are there for executing and monitoring steps and transitions in S7-GRAPH V5? How can you delay transition of steps as a function of the interlock? Information about the topic of "Executing / monitoring steps and transitions" Display part number Instructions: Instructions: Instructions: Instructions: There is information about the topic of "Executing / monitoring steps and transitions" available in the following manual and sections. Document Document Document Document Version Version Version Version Section Section Section Section Entry ID Entry ID Entry ID Entry ID Manual "S7-GRAPH V5.3 for S7-300/400 Programming Sequential Control Systems" 02/2004 06 Programming the Structure of a Sequencer 07 Programming Conditions and Actions 1137630 What tips and tricks are there for executing and monitoring steps and transitions in S7-GRAPH V5? Display part number Instructions: Instructions: Instructions: Instructions: This entry includes tips and tricks for executing and monitoring steps and transitions. 1. Disabling steps in the case of two or more sequencers in one step 2. Comments for the permanent operations 3. Monitoring two or more steps that are connected in series 4. Changing the block number of the standard FC72 5. Switching the transition to the next step when the conditions for transition and monitoring are fulfilled at the same time 6. Diagnostics data and activation times (e.g. "U") are not active 7. Querying results of a programmed transition 8. Setting the "L0 S" event when quitting the step although the interlock condition is not fulfilled The table below provides information and remedies for the above. No. No. No. No. Tips and tricks for executing and monitoring steps and transitions Tips and tricks for executing and monitoring steps and transitions Tips and tricks for executing and monitoring steps and transitions Tips and tricks for executing and monitoring steps and transitions 1 Disabling steps in the case of two or more sequencers in one step Disabling steps in the case of two or more sequencers in one step Disabling steps in the case of two or more sequencers in one step Disabling steps in the case of two or more sequencers in one step You can add more sequencers in S7-GRAPH FB (via "Add > Sequencer") and program them. More information is available in the S7-GRAPH Online Help under "New Sequencer". In each sequencer, the maximum number of active steps is equal to the number of simultaneous branches. The number of steps that you can disable in a step is equal to the maximum number of active steps. However, if you disable several steps in one step, this might lead to unwanted results in the processing of the sequencer. Página 1 de 12 Siemens Industry Online Support - Automation Service, Automation Support, Simat... 13/01/2013 https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Upload: jose-roberto-stanganini

Post on 30-Oct-2014

10 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: graph7

show the entry list

S7S7S7S7----GRAPH GRAPH GRAPH GRAPH -------- Creating S7 programs Creating S7 programs Creating S7 programs Creating S7 programs -------- Executing / monitoring steps and transitions Executing / monitoring steps and transitions Executing / monitoring steps and transitions Executing / monitoring steps and transitions

Information about the topic of "Executing / monitoring steps and transitions"What tips and tricks are there for executing and monitoring steps and transitions in S7-GRAPH V5?How can you delay transition of steps as a function of the interlock?

Information about the topic of "Executing / monitoring steps and transitions"Display part number

Instructions:Instructions:Instructions:Instructions:There is information about the topic of "Executing / monitoring steps and transitions" available in the following manual and sections.

DocumentDocumentDocumentDocument VersionVersionVersionVersion SectionSectionSectionSection Entry IDEntry IDEntry IDEntry ID

Manual"S7-GRAPH V5.3 for S7-300/400 Programming Sequential Control Systems"

02/2004 06 Programming the Structure of a Sequencer07 Programming Conditions and Actions

1137630

What tips and tricks are there for executing and monitoring steps and transitions in S7-GRAPH V5?Display part number

Instructions:Instructions:Instructions:Instructions:This entry includes tips and tricks for executing and monitoring steps and transitions.

1. Disabling steps in the case of two or more sequencers in one step2. Comments for the permanent operations3. Monitoring two or more steps that are connected in series4. Changing the block number of the standard FC725. Switching the transition to the next step when the conditions for transition and monitoring are

fulfilled at the same time6. Diagnostics data and activation times (e.g. "U") are not active7. Querying results of a programmed transition8. Setting the "L0 S" event when quitting the step although the interlock condition is not fulfilled

The table below provides information and remedies for the above.

No.No.No.No. Tips and tricks for executing and monitoring steps and transitionsTips and tricks for executing and monitoring steps and transitionsTips and tricks for executing and monitoring steps and transitionsTips and tricks for executing and monitoring steps and transitions1 Disabling steps in the case of two or more sequencers in one stepDisabling steps in the case of two or more sequencers in one stepDisabling steps in the case of two or more sequencers in one stepDisabling steps in the case of two or more sequencers in one step

You can add more sequencers in S7-GRAPH FB (via "Add > Sequencer") and program them. More information is available in the S7-GRAPH Online Help under "New Sequencer".

� In each sequencer, the maximum number of active steps is equal to the number of simultaneous branches.

� The number of steps that you can disable in a step is equal to the maximum number of active steps.

� However, if you disable several steps in one step, this might lead to unwanted results in the processing of the sequencer.

Página 1 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 2: graph7

Fig. 01 shows a function block with two sequencers. These sequences do not have any simultaneous branches, thus only a maximum of two steps can be active.

Fig. 01

Step 4 is active in Sequencer 1 and Step 14 is active in Sequencer 2. In Step 14, you can use the following actions, for example.

Fig. 02

Another example:Another example:Another example:Another example:

� S1 OFF S_ALLS1 ON Step1

2 Comments for the permanent operationsComments for the permanent operationsComments for the permanent operationsComments for the permanent operations

Página 2 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 3: graph7

Step comments can only be assigned for steps and transitions. Further information is available in the S7-GRAPH Online Help under

� "Comment, Name extension, Number, Name".3 Monitoring two or more steps that are connected in seriesMonitoring two or more steps that are connected in seriesMonitoring two or more steps that are connected in seriesMonitoring two or more steps that are connected in series

You can use a simultaneous branch to program the time monitoring of a series of steps. Fig. 03 shows the time monitoring of steps S2 and S3 via the simultaneous branch with step S5. The monitoring condition is defined as Supervision in Step 5. If the combined processing time for steps S2 and S3 exceeds monitoring time "U", step S5 goes into fault mode.

Fig. 03

Transition T1 enables steps S2 and S5 in the simultaneous branch. The simultaneous branch with S5 and the sequencer with S2 and S3 are processed simultaneously and closed with

Página 3 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 4: graph7

transition T3. Transition T3 switches to the next step S4

� If the sequencer and simultaneous branch have been processed and � The programmed monitoring time in step S5 has not yet been reached.

The input parameter "ACK_EF", which can be used to acknowledge the error, is assigned to flag M0.2.

Note:Note:Note:Note:Under "Tools > Customize Applications... > Tab: Editor" you can specify the "default values for time monitoring" for the parameters "SiT" and "SiU".

4 Changing the block number of the standard FC72Changing the block number of the standard FC72Changing the block number of the standard FC72Changing the block number of the standard FC72You can also change the block number of the standard FC72, for example to FC22 if there is already an FC72 in your project. Then, in S7-GRAPH under "Options > Block settings... > Tab: Compile/Save", under "Runnability", you must also change the number of the standard FC (e.g. to 22) and save the FB again.

5 Switching the transition to the next step when the conditions for transition and monitoring are Switching the transition to the next step when the conditions for transition and monitoring are Switching the transition to the next step when the conditions for transition and monitoring are Switching the transition to the next step when the conditions for transition and monitoring are fulfilled at the same timefulfilled at the same timefulfilled at the same timefulfilled at the same timeIf you program the same conditions for the monitoring and the stepping, the transition still steps when the sequencer is already in the monitored step. If both conditions (stepping and supervision) are fulfilled before the executing step, then a step is also active previously for at least one cycle in which the supervision is tested. Stepping of the sequencer to the next cycle is interrupted.

Note:Note:Note:Note:In one cycle, there is first the stepping procedure and then the remaining processing in the state. The sequencer thus always attempts to step as early as possible in a cycle, in order to trigger the actions of the next step in the cycle that follows reaching of the stepping condition (in the process).

Remedy:Remedy:Remedy:Remedy:Use different parameters for the monitoring and the stepping, as in Fig. 04, for example.

� M1.2 for the monitoring and � M1.3 for the stepping.

Página 4 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 5: graph7

Fig. 04

6 Diagnostics data and activation times (e.g. "U") are not activeDiagnostics data and activation times (e.g. "U") are not activeDiagnostics data and activation times (e.g. "U") are not activeDiagnostics data and activation times (e.g. "U") are not activeIf the activation time (e.g. "U") is not active, then most likely the standard block FC73 has been configured in the block settings in the "Compile / Save" tab. When using the FC73 with the option "Memory memorized" activated for "Interface Description", you can significantly reduce the memory requirement of the S7-GRAPH FB, because the memory required is under 8 KB. However, these generated blocks do not support diagnostics and only status displays are available when monitoring the runtime control. Since the FC73 of S7-GRAPH does not generate any diagnostics data, the activation time "U" is not available either.

Remedy:Remedy:Remedy:Remedy:Open the "Block settings" dialog in S7-GRAPH via "Tools > Block settings" and under "Runnability" in the "Compile / Save" tab you specify the standard FC72. Then change the Interface Description from "Memory minimized" to "Structure arrays" and acknowledge with OK. You must then recompile the S7-GRAPH FB and load the blocks into the CPU.

Página 5 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 6: graph7

Fig. 05

Note:Note:Note:Note:FC72 includes the complete system functionality and thus has a memory requirement of 11 KB.

7 Querying results of a programmed transitionQuerying results of a programmed transitionQuerying results of a programmed transitionQuerying results of a programmed transitionA structure is created in the instance DB for every transition. This structure includes the parameters "TV", "TT" and "TS", which contain information about a transition. This information about a transition is up-to-date as long as the corresponding step is active.

� TV: Transition is valid (type: BOOL) � TT: Transition is fulfilled (type: BOOL) � TS: Transition switches (type: BOOL)

The "Structure arrays" option must be selected in the block settings dialog (Fig. 5). Now you can access this structure internally (within the S7-GRAPH FB) or externally from a STEP 7 block (LAD / STL / FBD editor).

� T002.TTinternal access takes place via the transition number, followed by the name of the structure element.

� G7T[2].TTexternal access takes place via the field element, followed by the name of the structure element.

Fig. 06 contains a sample query of the results of Transition 2. With the instruction "U 

Página 6 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 7: graph7

Graph7_Instance_DB.G7T[2].TT" external access to the field element occurs. This external access is saved temporarily in a flag (symbolic: "Transition_2_true").

Fig. 06

Note:Note:Note:Note:The instance DB of the S7-GRAPH FB also contains the variable "MOP.T_PERM". If the signal status of the variable is "TRUE", the transitions of the sequencer are process permanently. The variables "TV", "TT" and "TS" of the transitions can be queried at any point. The variable "MOP.T_PERM" corresponds to the option "Permanent processing of transitions" for manual tests (can be activated via "Test > Control sequencer > Advanced > Permanent processing of transitions").

8 Setting the "L0 S" event when quitting the step although the interlock condition is not fulfilledSetting the "L0 S" event when quitting the step although the interlock condition is not fulfilledSetting the "L0 S" event when quitting the step although the interlock condition is not fulfilledSetting the "L0 S" event when quitting the step although the interlock condition is not fulfilledIn S7-GRAPH, an action can be triggered according to the change of the signal status of an interlock. In the case of the event "L0 S", the operand is set to 1 and the action is thus triggered as soon as the interlock condition for an active step changes the signal status from 0 to 1 (interlock condition comes, error goes).

Página 7 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 8: graph7

Creation environmentCreation environmentCreation environmentCreation environmentThe pictures in this FAQ were created with S7-GRAPH version V5.3.

A basic condition of S7-GRAPH is that a step that is not active cannot cause any errors. Thus an unfulfilled interlock condition is set to "fulfilled" upon leaving the step (the error is force acknowledged). Thus, when a step is left, an "L0 S" condition is always fulfilled and the programmed action triggered.

How can you delay transition of steps as a function of the interlock?Display part number

InstructionsInstructionsInstructionsInstructionsThe table below contains a few sample steps for delayed transition to the next step. An interlock is programmed in each of the Steps 1 to 4. The meanings of the interlock and the structure tags are as follows:

� Interlock C: a programmable condition for the interlock that affects the execution of individual actions.

� STEP1 U: uninterrupted step initialization time. � STEP1 T: total step initialization time. � STEP1 LA: Interlock is not fulfilled.

If, for example, the interlock is fulfilled in Step 1, the sequencer makes the transition to the next step after the specified time T2 and fulfilled transition.

No.No.No.No. Sample steps each with an example of transition to the next step as a function of the interlock:Sample steps each with an example of transition to the next step as a function of the interlock:Sample steps each with an example of transition to the next step as a function of the interlock:Sample steps each with an example of transition to the next step as a function of the interlock:

1 STEP 1STEP 1STEP 1STEP 1Time T2 starts as soon as the step is active and the interlock is fulfilled. Via querying in the following transition the transition to the next step is made after expiry of the specified time T2.

Fig. 01

Disadvantage Disadvantage Disadvantage Disadvantage If the interlock is not fulfilled when the step is entered, timer T2 is not started.

Note Note Note Note Timer T2 should be reset before the next use; this is done here upon leaving Step 1 with the action "S0 TR". Time T2 runs after the start independent of the interlock condition. Transition is made to the next step even if the interlock condition is not fulfilled.

2 STEP 2STEP 2STEP 2STEP 2Time T2 runs as soon as the interlock condition is fulfilled for an active step. This is implemented in that the interlock condition is fulfilled when the step is entered.

Página 8 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 9: graph7

Fig. 02

Disadvantage Disadvantage Disadvantage Disadvantage If the interlock is not fulfilled when the step is entered, timer T2 is not started. Timer T2 only starts when the condition in the active step is first deactivated and then activated again.

Note Note Note Note Timer T2 should be reset before the next use. This is done by leaving the step with the action "S0 TR". Time T2 runs after the start independent of the interlock condition. Transition is made to the next step even if the interlock condition is not fulfilled.

The disadvantages of STEP 1 and STEP 2 can be avoided by the combination of action "L1 TR T2". With action "L1 TR T2" the time is stopped if

� The interlock condition is no longer fulfilled in an active step. � The interlock condition is no longer fulfilled when the step becomes active.

3 STEP 3STEP 3STEP 3STEP 3The internal time is used instead of a timer. The specified time is an IEC time. Transition T3 switches step S3 to the next step when marker M0.2 or marker M200.0 receives the signal True after the specified time of 10 seconds. Both conditions are independent of the link in the interlock.

Fig. 03

Disadvantage Disadvantage Disadvantage Disadvantage The interlock in step S3 only prevents transition after expiry of the time and has no other significance for the step.

4 STEP 4STEP 4STEP 4STEP 4The internal IEC time is used instead of a timer. Here, only the time in which the step is uninterruptedly active is considered. Alternatively it would be possible to select the time in which the step duration T is counted. Transition is done via the comparison query.

Página 9 de 12Siemens Industry Online Support - Automation Service, Automation Support, Simat...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 10: graph7

Fig. 04

5 Another disadvantage of timers is that the timers used cannot be reset in the same cycle and used again. Therefore, different timers have to be used for steps that are active directly one after the other. In S7-GRAPH you also have the option of jumping steps. Via "Options > Block Options > Block Options > Block Options > Block Settings > Tab: Compile/SaveSettings > Tab: Compile/SaveSettings > Tab: Compile/SaveSettings > Tab: Compile/Save" you can activate the "Jump stepsJump stepsJump stepsJump steps" option via "Sequencer Sequencer Sequencer Sequencer PropertiesPropertiesPropertiesProperties". If the transition conditions before and after the step are fulfilled at the same time, the step does not become active if the "Jump steps" option is activated.

Fig. 05

6 Programming actions with the structure tags STEP3 U, STEP3 LA and STEP3 TProgramming actions with the structure tags STEP3 U, STEP3 LA and STEP3 TProgramming actions with the structure tags STEP3 U, STEP3 LA and STEP3 TProgramming actions with the structure tags STEP3 U, STEP3 LA and STEP3 TThe actions, as in Step 3 (D M200.0, T#10s or D C M200.0, T#10s), can also be replaced

Página 10 de 12Siemens Industry Online Support - Automation Service, Automation Support, Si...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 11: graph7

Note on the "Jump steps" option in the block settingsNote on the "Jump steps" option in the block settingsNote on the "Jump steps" option in the block settingsNote on the "Jump steps" option in the block settingsIn normal operation, the transition of the current step is checked when the S7-GRAPH FB is called. If the transition is fulfilled, there is a jump to the next step which is then executed. The S7-GRAPH FB is quitted regardless of whether the next transition is fulfilled or not and the remainder of the cyclic program is processed.

With the "Jump steps" option in the S7-GRAPH sequencer control, the processing jumps to the next step whose transition is not fulfilled and executes it. All the steps between the last step executed and the currently active step (i.e. the steps in which both the previous and the following transitions are fulfilled) are not processed.

When the "Jump steps" option is activated, the interlock of a critical step is processed in a different block after the S7-GRAPH FB is called. If there are several other steps between the initial step and

through querying of STEP3.U, STEP3.LA or STEP3.T. For example, the action "D C M200.0, T#10s" corresponds to the condition "STEP3.LA AND STEP3.T>=T#10s" in the transition. 

More actions (Fig. 06)More actions (Fig. 06)More actions (Fig. 06)More actions (Fig. 06)

� Calculation of the number of cycles without interlock (Step 7). � Calculation of the last time without interlock (Step 8).

You can use the standard function FC25 (MAX) from the "IEC Function Blocks" library to calculate the maximum time without interlock. This FC can be called in the step.

� Calculation of the flag for: "The step was not interlocked for at least one cycle" (Step 9).The parameters required ("S1 R Operand" or "S1 N Operand:= Initial value") are initialized in the first cycle and in the following cycles the parameters are changed according to the interlocking condition.

Fig. 06

Página 11 de 12Siemens Industry Online Support - Automation Service, Automation Support, Si...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...

Page 12: graph7

the target step, this is not a problem, because there are several OB1 cycles before the critical step is reached. In normal operation the interlock is thus always processed before the critical step is reached.

With the "Jump steps" option, the block with the interlock might be processed only after the critical step - if all the steps between the initial step and the critical step have been jumped. Thus the interlock is not fulfilled before the critical step is reached and the step is marked red in the sequencer control.

In the case described, in order to achieve the same behavior as in normal operation even if the "Jump steps" option is used, the block with the interlock processing must be called before the S7-GRAPH FB.

KeywordsKeywordsKeywordsKeywordsInterlocking, Condition, Step interlock, Interlock Entry ID:Entry ID:Entry ID:Entry ID:22072819 Date:Date:Date:Date:2011-04-27I regard this article....I regard this article....I regard this article....I regard this article.... as helpful as not helpful

Copy link Send to a friend

Print

© Siemens AG 2013 - Corporate Information - Privacy Policy - Terms of Use

Página 12 de 12Siemens Industry Online Support - Automation Service, Automation Support, Si...

13/01/2013https://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=22072819&n...