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.

668 Structured Text ProgrammingUse logical operatorsLogical operators let you check if multiple conditions are true or false.The result of a logical operation is a BOOL value:If The Comparison IsThe Result Istrue 1false 0Use the following logical operators:For Use This Operator Data Typelogical AND &, AND BOOLlogical OR OR BOOLlogical exclusive OR XOR BOOLlogical complement NOT BOOLFor example:Use This FormatBOOLtagNOT BOOLtagexpression1 & expression2expression1 OR expression2expression1 XOR expression2BOOLtag := expression1 &expression2ExampleFor This SituationIf photoeye is a BOOL tag and your specificationsays: “If photoeye is on then…”If photoeye is a BOOL tag and your specificationsays: “If photoeye is off then…”If photoeye is a BOOL tag, temp is a DINT tag,and your specification says: “If photoeye is onand temp is less than 100° then…”.If photoeye is a BOOL tag, temp is a DINT tag,and your specification says: “If photoeye is onor temp is less than 100° then…”.If photoeye1 and photoeye2 are BOOL tags andyour specification says: “If:• photoeye1 is on while photoeye2 is off or• photoeye1 is off while photoeye2 is onthen…"If photoeye1 and photoeye2 are BOOL tags,open is a BOOL tag, and your specification says:“If photoeye1 and photoeye2 are both on, setopen to true”.You’d WriteIF photoeye THEN...IF NOT photoeye THEN...IF photoeye & (temp

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

Saved successfully!

Ooh no, something went wrong!