12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

674 Structured Text ProgrammingExample 3:IF…THEN…ELSIFIf You Want ThisEnter This Structured TextIf sugar low limit switch = low (on) and sugar high limit IF Sugar.Low & Sugar.High THENswitch = not high (on) theninlet valve = open (on) Sugar.Inlet [:=] 1;Until sugar high limit switch = high (off)ELSIF NOT(Sugar.High) THENSugar.Inlet := 0;END_IF;The [:=] tells the controller to clear Sugar.Inlet whenever thecontroller:• enters the RUN mode• leaves the step of an SFC if you configure the SFC for Automaticreset (This applies only if you embed the assignment in theaction of the step or use the action to call a structured textroutine via a JSR instruction.)Example 4:IF…THEN…ELSIF…ELSEIf You Want ThisEnter This Structured TextIf tank temperature > 100IF tank.temp > 200 THENthen pump = slow pump.fast :=1; pump.slow :=0; pump.off :=0;If tank temperature > 200ELSIF tank.temp > 100 THENthen pump = fast pump.fast :=0; pump.slow :=1; pump.off :=0;otherwise pump = offELSEpump.fast :=0; pump.slow :=0; pump.off :=1;END_IF;Publication 1756-RM003I-EN-P - January 2007

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!