Overview of Structured Text Programming 
 
650  Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018 
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.) 
Example 3 
IF…THEN…ELSIF 
If you want this  Enter this structured text 
If sugar low limit switch = low (on) and sugar high limit switch = not high 
(on) then 
IF Sugar.Low & Sugar.High THEN 
inlet valve = open (on)  Sugar.Inlet [:=] 1; 
Until sugar high limit switch = high (off )  ELSIF NOT(Sugar.High) THEN 
Sugar.Inlet := 0; 
END_IF; 
The [:=] tells the controller to clear Sugar.Inlet whenever the controller does the 
following : 
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.) 
Example 4 
IF…THEN…ELSIF…ELSE 
If you want this  Enter this structured text 
If tank temperature > 100  IF tank.temp > 200 THEN 
then pump = slow  pump.fast :=1; pump.slow :=0; pump.off :=0; 
If tank temperature > 200  ELSIF tank.temp > 100 THEN 
then pump = fast  pump.fast :=0; pump.slow :=1; pump.off :=0; 
Otherwise pump = off  ELSE 
pump.fast :=0; pump.slow :=0; pump.off :=1; 
END_IF;