G60: Arithmetic Operations - Omron CS1W-MC221 - 02-2008 Operation Manual

Motion control units
Table of Contents

Advertisement

G-language Commands

7-3-20 G60: ARITHMETIC OPERATIONS

Format
Operands
Description
Programming Example
420
Performs arithmetic operations on position data and registers.
G60_<first term = second term operator third term>
The following table shows the possible settings for the operands.
Operand
First term
A0000 to A1999
E00 to E31
Second term
A0000 to A1999
E00 to E31
39,999,999
Operator
+, –, *, or /
(addition, subtraction, multiplication, or division)
Third term
A0000 to A1999
E00 to E31
39,999,999
This command performs arithmetic operations on numerical values, position
data, or the contents of registers. When the first term is a register, the second
and third terms will be integers. (Non-integer values are rounded to the near-
est integer.)
Example
If G60: E00 = 0.4 + 0.4 is executed, then zero will be substituted at E00.
When the first term is a position data address, the second and third terms will
be real numbers and values below the fifth decimal place will be rounded off.
Example
If G60: A0000 = 1.2345 x 1.01 is executed, then zero will be substituted at
A0000.
The possible values for the result are as follows:
–39,999,999 to –0.0001
0
0.0001 to 39,999,999
An error will occur if the first term's data is not within the acceptable range.
The possible values for the first term are as follows:
When the first term is position data:
When the first term is a register:
Registers are cleared to zero if the power is turned ON or the system is
restarted.
Substitute values when registers are used.
The following example shows subtracting 500 from the value at A1000 and
substituting the result at A0000.
:
:
N010
G60
A0000=A1000–500
:
:
Possible settings
–39,999,999 to +39,999,999
0000 to 1999
Section 7-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cs1w-mc221Cs1w-mc221-v1Cs1w-mc421Cs1w-mc421-v1

Table of Contents