Example 3, Example 4 – Rockwell Automation Logix5000 Controllers Structured Text Programming Manual User Manual

Page 24

Advertising
background image

24

Publication 1756-PM007D-EN-P - November 2012

Chapter 1 Program Structured Text

Example 3:

IF…THEN…ELSIF

The [:=] tells the controller to clear Sugar.Inlet 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.)

Example 4:

IF…THEN…ELSIF…ELSE

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;

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;

Advertising