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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

660 Structured Text ProgrammingTerm Definition Examplesexpression(see page 28-663)An expression is part of a complete assignment or construct statement.An expression evaluates to a number (numerical expression) or to a trueor false state (BOOL expression).An expression contains:tagsA named area of the memory where data is stored value1(BOOL, SINT,INT,DINT, REAL, string).immediates A constant value. 4operators A symbol or mnemonic that specifies an operationwithin an expression.tag1 + tag2tag1 >= value1functions When executed, a function yields one value. Useparentheses to contain the operand of a function.function(tag1)instruction(see page 28-670)Even though their syntax is similar, functions differfrom instructions in that functions can only be usedin expressions. <strong>Instructions</strong> cannot be used inexpressions.An instruction is a standalone statement.An instruction uses parenthesis to contain its operands.Depending on the instruction, there can be zero, one, or multipleoperands.When executed, an instruction yields one or more values that are part ofa data structure.Terminate the instruction with a semi colon “;”.instruction();instruction(operand);instruction(operand1,operand2,operand3);Even though their syntax is similar, instructions differ from functions inthat instructions cannot be used in expressions. Functions can only beused in expressions.Publication 1756-RM003I-EN-P - January 2007

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

Saved successfully!

Ooh no, something went wrong!