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.

Structured Text Programming 673The following table summarizes different combinations of IF, THEN,ELSIF, and ELSE.If You Want To And Use This Constructdo something if or when conditionsare truechoose from alternative statements(or groups of statements) based oninput conditionsdo nothing if conditions are falsedo something else if conditions are falsedo nothing if conditions are falseassign default statements if allconditions are falseIF…THENIF…THEN…ELSEIF…THEN…ELSIFIF…THEN…ELSIF…ELSEArithmetic Status FlagsFault Conditions:Example 1:not affectednoneIF…THENIf You Want ThisEnter This Structured TextIF rejects > 3 thenIF rejects > 3 THENconveyor = off (0) conveyor := 0;alarm = on (1) alarm := 1;END_IF;Example 2:IF…THEN…ELSEIf You Want ThisEnter This Structured TextIf conveyor direction contact = forward (1) then IF conveyor_direction THENlight = off light := 0;Otherwise light = onELSElight [:=] 1;END_IF;The [:=] tells the controller to clear light whenever the controller:• 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.)Publication 1756-RM003I-EN-P - January 2007

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

Saved successfully!

Ooh no, something went wrong!