Reference Manual

PMAC 2 Software Reference
336 PMAC Program Command Specification
A line only needs a label in order to jump to that line. Line labels do not have to be in
any sort of numerical order. The label must be at the beginning of a line. Remember that
each location label takes up space in PMAC memory.
Example
O1
O65537 X1000
See Also
Subroutines and Subprograms (Writing a Motion Program)
On-line command B{constant}
Program commands O{constant}, GOTO, GOSUB, CALL, G, M, T, D.
OR({condition})
Function
Conditional OR
Type
PLC program
Syntax
OR ({condition})
Remarks
This statement forms part of an extended compound condition to be evaluated in a PLC
program. It must immediately follow an IF, WHILE, AND, or OR statement. This OR is
a boolean operator logically combining the condition on its line with the condition on the
program line above.
It takes lower precedence than operators within a compound condition on a single line
(those within parentheses), and also lower precedence than an AND operator that starts a
line. (ORs operate on groups of ANDed conditions.)
In motion programs, there can be compound conditions within one program line, but not
across multiple program lines, so this statement is not permitted in motion programs.
Note:
This logical OR, which acts on conditions, should not be confused with
the bit-by-bit | (vertical bar) or-operator, which operates on values.
Example
IF (M11=1) ; This branch increments P1 every cycle that
AND (M12=0) ; inputs M11 and M12 are different, and decrements
OR (M11=0) ; them every cycle that they are the same.
AND (M12=1)
P1=P1+1
ELSE
P1=P1-1
ENDIF
IF (M11=1 AND M12=0) ; This does the same as above
OR (M11=0 AND M12=1)
P1=P1+1
ELSE
P1=P1-1
ENDIF
See Also
Conditions (Program Computational Features)
Writing a PLC Program
Program commands IF, WHILE, AND