Creating the Program in SFC for Managing the Tank
Original instructions
At a Glance
The main program is written in SFC (Grafcet). The different sections of the grafcet steps and transitions are written in LD. This program is declared in a MAST task, and will depend on the status of a Boolean variable.
The main advantage of SFC language is that its graphic animation allows us to monitor in real time the execution of an application.
Several sections are declared in the MAST task:
NOTE: The LD, SFC and FBD-type sections used in the application must be animated in online mode, with the PLC in RUN
Illustration of the Tank_management Section
The following screen shows the application Grafcet:
For actions and transitions used in the grafcet, refer to chapter Actions and transitions.
NOTE: For more information on creating an SFC section, refer to chapter SFC Editor.
Description of the Tank_management Section
The following table describes the different steps and transitions of the Tank_management Grafcet:
Step / Transition
Description
Initial
This is the initial step.
Initial_condition
This is the transition that starts the pump. The transition is valid when the variables:
  • Stop = 0,
  • Run = 1,
  • Tank_High_Level = 0,
  • Lim_valve_closure = 1
  • Desired_Level > 0
Init_Pump
This is the step initiate the pump flow rate.
Filling_Start
This transition is active when the pump flow rate is initialized.
Tank_Filling
This is the step that starts the pump and filling of the tank until the high level is reached. This step activates the motor DFB in the Application section, which controls the activation of the pump.
Reached_Level
This transition is active when the tank’s desired level is reached.
End_Alarm
This is the step that lights the Tank ready led
Drain
This transition is active when the operator click on the Drain Tank button (Drain = 1).
Tank_Drain_2
This step is identical to Tank_Drain.
Tank_Low_Level
This transition is active when the low level of the tank is reached (Tank_Low_Level = 1).
With_fault
This transition is active when High_Safety_Alarm = 1 or the Stop_cycle button has been activated (Stop_cycle = 1).
Tank_Drain
This step activates the valve DFB in the Application section, which controls the opening of the valve.
Empty_Tank
This transition is valid when the tank is empty (Tank_Low_Level = 1 and Pump_Flow = 0.0).
Filling in progress
This transition is valid when the filling of the tank is in progress.
Pump_Flow_Reduction
This is the step that reductes the pump flow rate.
Flow_Reduction
This is the value of the flow rate after reduction.
NOTE: You can see all the steps and actions and transitions of your SFC by clicking on in front of the name of your SFC section.
Procedure for Creating an SFC Section
The table below shows the procedure for creating an SFC section for the application.
Step
Action
1
In Project Browser\Program\Tasks, double-click on MAST.
2
Right click on Section then select New section. Give your section a name (Tank_management for the SFC section) then select SFC language.
3
The name of your section appears, and can now be edited by double clicking on it.
4
The SFC edit tools appear in the window, which you can use to create your Grafcet.
For example, to create a step with a transition:
  • To create the step, click on then place it in the editor,
  • To create the transition, click on then place it in the editor (generally under the preceding step).