Download Print this page

Omron NS Reference Manual page 14

Hide thumbs Also See for NS:

Advertisement

Section 1 Outline of Macro Function
NS series Macro Reference
Basic Operational Statements
The following operational statements can be used in the program.
Item
substitution
addition
subtraction
multiplication
division
residue
OR
AND
NOT
Exclusive
Complement of 1
Bit Shift (left)
Bit Shift (right)
Reference
If executing logical operation, process must be performed between the same data types
(between word, bit, or long access)
E.g.$SW0L=$SW10L&$W20L;'Use all long access of word'
Multiple operations can be combined.
E.g. A=(B+C)*(D+E/2)
The priority of orders is as follows.
High
Low
Operator
=
+
-
*
/
%
|
&
!
ˆ
~
<<
>>
Item
( )
~
*, /,%
+, -
<< ,>>
&
ˆ
|
=
Example
A = B
Substitute B for A
C = A+B
Set A+B to C
C = A–B
Set A–B to C
C = A*B
Set AxB to C
C = A/B
Set A/B to C
C = A%B
Set A%B to C
C = A|B
Logically ORs for A and B
C = A & B
Logically ANDs for A and B
C = !A
Set C for denial of A
C = A^B
Result C of logical XORs for A and B
B = ~A
Set the 1-complement of A to B
C = A<<B
Set the value that A is ltic shifted B-
bit to the left to C.
C = A>>B
Se the value that A is arithmetic
shifted B-bit to the right to C.
Symbol
1-12
meaning

Advertisement

loading

This manual is also suitable for:

Ns-series