Learning phase 10: Forced Commands

Forced commands are assigned to the structuring elements in GRAFCET in much the same way as enclosing steps and macro steps. This assignment is not obvious, as a forced command places a partial GRAFCET chart in a specific situation (i.e. forced).

The legitimacy of this assignment becomes evident, however, when the following scenario is played out: The partial GRAFCET chart G1 contains a forced command which influences the partial GRAFCET chart G2. This places the partial GRAFCET chart G1 in the (command) hierarchy above the partial GRAFCET chart G2. Furthermore, a forced command does not influence a single operand, such as a continous action, but a complete partial GRAFCET chart. This means the forced partial GRAFCET chart must be stored in a separate border.

This makes it clear that forced commands create hierarchical levels in the GRAFCET chart and make the formation of partial GRAFCET charts necessary. To label these as structuring elements is therefore quite appropriate, since they force the programmer to structure the GRAFCET chart so as to enable the application of the commands at all.

GRAFCET has four forced commands which place the partial GRAFCET chart specified into a specific situation. This situation remains unchanged as long as the forced command is being performed.

A forced command is linked with a step, such as a continous action. The symbol for a forced command is a box with a double frame.

Learning steps:

  • Definition of forced commands
  • Application of forced commands

The four types of forced commands need to be defined first. As already mentioned, the commands differ in that they place the partial GRAFCET chart specified in different situations. The forced commands are attached to a step. If the step is active, forcing is performed. There are four command variants here:

Forcing to the current situation:
The forced command depends on step 2 and affects the partial GRAFCET chart G3. The variant of the command is defined in the curly brackets. The character "*" is indicated in the view. This means that the forced command is retaining the partial GRAFCET chart in the current situation or freezes it. All steps in the partial GRAFCET chart G3 keep their current activation statuses, and so do the actions. No transitions take place.

Forcing to a specific situation:
The forced command depends on step 3 and affects the partial GRAFCET chart G3. The variant of the command is defined in the curly brackets. In the figure, the label for the step is also defined, which is force-activated. All other steps in G3 are deactivated. This also has the corresponding effects on the actions linked to the steps. You can also define several step labels inside the curly brackets. These are then separated by a comma (e.g. G3 {100, 110, 120}). Please note that, with respect to one another, the steps indicated are not arranged linearly, since only one step can be active in such a case. The steps can therefore, for example, originate from different partial sequences in a parallel sequence.

Forcing to the empty situation: The forced command depends on step 5 and affects the partial GRAFCET chart G3. The variant of the command is defined in the curly brackets. The callout inside the brackets is blank for this command. The command deactivates all the steps in the partial GRAFCET chart G3. So long as the command is being performed, steps cannot be activated in the partial GRAFCET chart G3. This is only possible again, if step 5 is exited in the example and thus, the command is no longer being performed.

Forcing to the initial situation:
The forced command depends on step 4 and affects the partial GRAFCET chart G3. The variant of the command is defined in the curly brackets. "INIT" is to be specified as the command code for this command. The command returns the partial GRAFCET chart G3 to its initial situation, i.e. the initial steps are activated and all other steps are deactivated. This situation is maintained as long as the command is being performed.

You should now be familiar with the different command variants for forced commands. Forcing to the initial situation is shown in the following example.

The example () consists of a main GRAFCET with the steps 1 and 2. A forced command is attached to step 1. The command "Forcing to the initial situation" has been used here, which is defined by the keyword INIT inside the brackets. The partial GRAFCET chart G1 is stated in the command, which is influenced by the command as a result. The partialGRAFCET chart G1 is located within a border with precisely this label G1 in the bottom left-hand corner.

The figure shows the time when step 1 is active and the forced command is executed as a result. For the partial GRAFCET chart in G1, this means that initial step 3 is activated and all other steps are deactivated.

As long as the command is being performed, a transition from step 3 to step 4 cannot take place. The partial GRAFCET chart G1 therefore remains in the illustrated situation.

Fig. 3.142 Partial GRAFCET chart G1 is forced by the command G1{INIT}.

Fig. 3.143 Partial GRAFCET chart G1 is no longer influenced by the forced command.

In you can see the time when the transition from step 1 to step 2 has been performed, because the transition condition S1Start is fulfilled. This means that the forced command at step 1 is no longer being executed. Partial GRAFCET chart G1 is no longer being forced as a result. This means than changes can occur again in the partial GRAFCET chart G1; In the figure, the transition from step 3 to step 4 has already been completed.

Fig. 3.144 Forcing with the commands "Forcing to the initial situation" and "Forcing to the empty situation"

Fig. 3.144 shows another example, this time with two forced commands. The command with the keyword INIT was already used in the last example. A command "Forcing to the empty situation" is attached to step 104, which influences the partial GRAFCET chart G100. No forced commands are being performed at the time shown in the figure, i.e. G100 is not forced to a specific situation. This can also be seen by the fact that in G100 step 102 is active.

In the situation is different.

Fig. 3.145 Partial GRAFCET chart G100 is forced to the empty situation.

Step 104 is active here, and therefore the forced command is performed at this step, which forces G100 to the empty situation. This means that all steps in G100 are deactivated and the partial GRAFCET chart remains in this situation. If the transition from step 104 to step 105 takes place, then also the command is no longer performed. This does not change much in G100 however, because the steps initially remain deactivated. Only when step 1 is active in the main GRAFCET chart and thus the initialisation step 100 of the partial GRAFCET chart G100 is forced into being active, are the pre-conditions for changes in the partial GRAFCET chart G100 given. However, something can only change once step 1 has been exited, because, otherwise, G100 will remain in the initial situation due to the forced command.

The example also shows that, after applying a forcing to an empty situation, thought must be given as to how the forced partial GRAFCET chart is to be 'brought back to life'. In this case, the commands "Forcing to a specific situation" or "Forcing to the initial situation" can be used.

PLC-Lab Filename GRAFCET-Studio Filename
HandAutoUmschaltung.plclab HandAutoUmschaltung.grafcet

Manual/Automatic operation is to be realised for a system. The operating modes are set by a switch and displayed over the signal lamps H1 and H2. If the Manual/Automatic switch is pressed, Automatic mode becomes active and S1ManualAutomatic has the value True.

Fig. 3.146 Diagram of the technology for using the operating mode selection Manual/Automatic

Definition of the operands:

Symbol Description
S1ManualAutomatic "Manual/Automatic" switch, pressed = True = automatic
P1Automatic "Automatic" lamp
P2Manual "Manual" lamp

Fig. 3.147 Solution for Manual/Automatic switching with forced commands

The solution is shown in the figure above. It consists of a main GRAFCET chart with both forced commands at step 1 and step 2. Next to this, the two partial GRAFCET charts G10 and G20 are depicted. G10 contains the GRAFCET chart for Manual mode, while G20 contains the GRAFCET chart for Automatic mode.

Fig. 3.148 The "Manual" operating mode is selected.

In the Manual mode S1ManualAutomatic is selected. In the main GRAFCET chart, step 1 is active and therefore the command G20{INIT} is performed. As a result, the partial GRAFCET chart G20 (Automatic) is forced into the initial situation. This is shown in the figure by the initial step 20 being active. Currently no forced command is influencing the partial GRAFCET chart G10 (Manual).

Fig. 3.149 Automatic mode is selected.

shows Automatic mode being selected. Step 2 is therefore active and the command G10{INIT} is performed. This means that the partial GRAFCET chart G10 is being forced and remains in the initial situation. Partial GRAFCET chart G20, on the other hand, is no longer being forced, because the command G20{INIT} is only performed as long as step 1 is active. That is not the case here.

  • Forced commands are assigned to the structuring elements in GRAFCET.
  • Forced commands exert their forcing on partial GRAFCET charts which are located inside borders and are prefixed with G.
  • A precondition for the use of forced commands is that the GRAFCET chart must be structured in such a way that the forced steps are in a partial GRAFCET chart.
  • GRAFCET has four different forced command variants.
  • The command variant for the forced command is defined by the content in curly brackets.
  • Forced commands create hierarchical levels. The GRAFCET chart with the forced command is on a higher level than the partial GRAFCET chart which the command is affecting.

PLC-Lab Filename GRAFCET-Studio Filename
EbeneSelektion.plclab EbeneSelektion.grafcet

A hierarchy with a total of three levels is to be implemented in GRAFCET. The GRAFCET chart consists of a main GRAFCET chart and the two partial GRAFCET charts G20 and G30. G20 contains the Manual mode for the system. G30 contains the Automatic mode for the system. For the sake of simplicity, selection of the individual level is carried out with a slide control. If Level 1 is selected, then S1Level1 has the status True, at Level 2, S2Level2 has the status True and when Level 3 is selected, S3Level3 is set to True.

The significance of the levels:

Level 1: Represents the "Emergency shutdown" situation. This influences G30 through the forced command G30{}. Furthermore, Manual mode in G20 is prepared by the forced command G20{INIT} being performed.

Level 2: Manual operation is active at this level. Manual mode G20 is not forced and Automatic mode G30 is influenced with G30{INIT}.

Level 3: Automatic mode is active, G30 is not being forced. G20 is influenced over the command G20{INIT}.

Each level set is to be displayed by the lamps H1Level1, H2Level2 and H3Level3.

Fig. 3.150 Diagram of the technology for the three-level hierarchy

Definition of the operands:

Symbol Description
S1Level1 True = Level 1 is selected (emergency stop)
S2Level2 True = Level 2 is selected (manual)
S3Level3 True = Level 3 is selected (automatic)
P1Level1 "Level 1" lamp
P2Level2 "Level 2" lamp
P3Level3 "Level 3" lamp

The solution was implemented with linked labels.

Fig. 3.151 Solution for training exercise with three hierarchy levels

PLC-Lab Filename GRAFCET-Studio Filename
Bohranlage.plclab Bohranlage.grafcet

A GRAFCET for a drilling unit with manual and automatic operating modes is to be developed. The system is also to have an Emergency Stop switch.

If the control is switched on and Automatic mode has been selected, the following action is initiated with the Start button:

  1. Switch on M1Drill.
  2. The drill extends to the front-end position after two seconds.
  3. The drill remains in the front-end position for three seconds.
  4. The drill retracts and M1Drill is switched off. The fan turns on.
  5. The fan remains switched on for four seconds and then switches off.

Fig. 3.152 Diagram of the technology for the drilling unit

The automatic sequence is to be transferred to partial GRAFCET chart G1 and manual operation to partial GRAFCET chart G2. With Emergency Stop, both partial GRAFCET charts G1 and G2 should be deactivated with the forced command "Forcing to the empty situation". In Manual mode, all movements can be performed separately to one another if the control is switched on. Corresponding buttons are available for each of the system actions (setup mode) for Manual mode.

Note: The actuators switched on in Manual mode also remain switched on when Manual mode has been deselected. The actuators therefore need to be switched off manually before Manual mode is exited. For the sake of simplicity, the process of switching off the actuators when leaving Manual mode has been dispensed with here.

Definition of the operands:

Symbol Description
S1ControlOn "Control On" button, pressed = True
S2ControlOff "Control Off" button, pressed = False
S3EmergencyStop "Emergency stop" switch, pressed = False
S4ManualAuto "Manual/Automatic" switch, pressed = True = Manual
S5DrillUpDownManual "Drill down/up Manual" button, pressed = True, pressed = downwards
S6DrillOnManual "Drill on Manual" button, pressed = True
S7DrillOffManual "Drill off Manual" button, pressed = True
S8FanOnManual "Fan on Manual" button, pressed = True
S9FanOffManual "Fan off Manual" button, pressed = True
S10DrillRetracted "Drill retracted" sensor, pressed = True
S11DrillExtended "Drill extended" sensor, pressed = True
S12StartAutomatic "Start" button, pressed = True
P1ControlOn "Control On" lamp
P2ManualOn "Manual On" lamp
M1Drill Drill motor
A1DrillExtendedRetract Extend/Retract drill actuator, True = Extend
M2Fan Fan motor

Fig. 3.153 Main GRAFCET chart for the drilling unit

Linked labels have been used in the main GRAFCET chart to make the GRAFCET clearer. In so doing, the respective label for the linked step is given at the linked label, symbolised by an arrow symbol. For example, if the callout is 1, then the programme skips to step 1.

Fig. 3.154 Automatic sequence for the drilling unit in the partial GRAFCET chart G1

Fig. 3.155 Manual mode for the drilling unit in the partial GRAFCET chart G2

  • How many forced command variants are possible in GRAFCET?
  • Name the command variants for forced commands in GRAFCET.
  • What callout must be specified in curly brackets to give a forced command for the variant "Forcing to a specific situation?
  • The forced command G10{} is performed. What impact does this have on partial GRAFCET chart G10?
  • Which GRAFCET chart does the hierarchy place higher here: the partial GRAFCET chart with the forced command or the partial GRAFCET chart which is influenced by the forcing of the command?
  • Why can forced commands be referred to as structuring elements?

Forced partial GRAFCET charts:

When a GRAFCET is forced, the statuses of the steps are set to a pre-defined status and do not change. You should note, however, that continous actions are performed: When an action is linked to an active step, the operand in the action is set to True. If the step is idle, it is set to False, unless the operand is also being used in another continuing action, and the step associated with this action has the status True.