
Publication 1756-PM007D-EN-P - November 2012 27
Program Structured Text Chapter 1
Example
The [:=] tells the controller to also clear the outlet tags whenever the
controller:
• enters the Run mode.
• leaves the step of an SFC if you configure the SFC for Automatic reset.
(This applies only if you embed the assignment in the action of the step
or use the action to call a structured text routine via a JSR instruction.)
If you want this Enter this structured text
If recipe number = 1 then
CASE recipe_number OF
Ingredient A outlet 1 = open (1)
1: Ingredient_A.Outlet_1 :=1;
Ingredient B outlet 4 = open (1)
Ingredient_B.Outlet_4 :=1;
If recipe number = 2 or 3 then
2,3: Ingredient_A.Outlet_4 :=1;
Ingredient A outlet 4 = open (1)
Ingredient_B.Outlet_2 :=1;
Ingredient B outlet 2 = open (1)
If recipe number = 4, 5, 6, or 7 then
4..7: Ingredient_A.Outlet_4 :=1;
Ingredient A outlet 4 = open (1)
Ingredient_B.Outlet_2 :=1;
Ingredient B outlet 2 = open (1)
If recipe number = 8, 11, 12, or 13 then
8,11..13 Ingredient_A.Outlet_1 :=1;
Ingredient A outlet 1 = open (1)
Ingredient_B.Outlet_4 :=1;
Ingredient B outlet 4 = open (1)
Otherwise all outlets = closed (0)
ELSE
Ingredient_A.Outlet_1 [:=]0;
Ingredient_A.Outlet_4 [:=]0;
Ingredient_B.Outlet_2 [:=]0;
Ingredient_B.Outlet_4 [:=]0;
END_CASE;
Komentarze do niniejszej Instrukcji