![background image](http://html1.mh-extra.com/html/omron/cs1w-mch71/cs1w-mch71_operation-manual_742367407.webp)
362
Command Details
Section 6-3
Simple Arithmetic
Operations (+,
−
, *, /,
%, ^)
This command executes the specified simple arithmetic operations.
Command type
+,
−
, *, /, %, and ^: Not executed as an independent command (no type).
Format
<First term> = <Second term> Operator <Third term>;
Ex: #MF1000 = # #MF0012;
Operand
Note
Both immediate values and variables can use the values within the ranges
defined for each type.
• Integer immediate value:
−
2147483648 to 2147483647
• Decimal immediate value:
−
2147483648. to 2147483647.
• Bit type: 0, 1
• Word type:
−
32768 to 32767
• Long word type:
−
2147483648 to 2147483647
• Real number type:
±
(1.175E-38 to 3.402E+38), 0
• Indirect specification type: 0 to 10239
Description
• The following operators are used in operations.
• If the types are different on both sides, the type on the right is converted
to that of the left.
• If the value on the right side cannot be stored in the left side, the alarm
[2005h: Operation overflow] will occur.
Operand
Setting range
Decimal
Variable specification
INC/ ABL
influ-
ence
Bit
Word
Long
word
Real
number
Indirect
specifi-
cation
First term
Variable
No
No
Yes
Yes
Yes
No
No
Second term
Operation
numerical value
range (See
note.)
Yes
No
Yes
Yes
Yes
Yes
No
Third term
Operation
numerical value
range (See
note.)
Yes
No
Yes
Yes
Yes
Yes
No
Operator
Function
Description
+
Add
Adds the 2nd and 3rd terms, and assigns the result
to the 1st term.
−
Subtract
Subtracts the 3rd term from the 2nd, and assigns the
result to the 1st term.
*
Multiply
Multiplies the 2nd and 3rd terms, and assigns the
result to the 1st term.
/
Divide
Divides the 2nd term by the 3rd, and assigns the
result for the 1st term.
%
Reminder
Remainder from the division of the 2nd term by the
3rd is assigned to the 1st term.
^
Exponent
Raises the 2nd and the 3rd terms, and assigns the
result for the 1st.
Содержание CS1W-MCH71 -
Страница 2: ...CS1W MCH71 CJ1W MCH71 Motion Control Unit Operation Manual Revised June 2008 ...
Страница 3: ...iv ...
Страница 29: ...xxx ...
Страница 33: ...xxxiv ...
Страница 35: ...xxxvi ...
Страница 39: ...xl ...
Страница 69: ...24 Performance Section 1 7 ...
Страница 99: ...54 Connecting MECHATROLINK Devices Section 3 5 ...
Страница 283: ...238 Saving Data Section 5 4 ...
Страница 417: ...372 Command Details Section 6 3 ...