Operators; Conditions - Hitachi SJ700-2 Series Instruction Manual

Easy-sequence programming software ezsq
Hide thumbs Also See for SJ700-2 Series:
Table of Contents

Advertisement

(2) Numeric notation
Notation
(Omitted)
&H
&B
Note: If the calculation executed for a variable by clicking the [Calculate] button results in a value that is
outside the range of numeric values defined for the variable, the "User data range is invalid"
message will appear and the "Answer" field will indicate "<Range invalid>."

3.4 Operators

You can use the following operators for a program:
Specification format
<variable 1> =
<variable 2> +
<variable 1> =
<variable 2> -
<variable 1> =
<variable 2> *
<variable 1> =
<variable 2> /
<variable 1> =
<variable 2> mod
<variable 1> =
<variable 1> =
<variable 1> =
<variable 2> or
<variable 1> =
<variable 2> and
<variable 1> =
<variable 2> xor
<variable 1> =
Note 1: <variable 2> can be a constant ranging from 0 to 127.
Note 2: <variable 3> can be a constant ranging from -2^31 to 2^31-1.

3.5 Conditions

You can use a conditional expression to compare two variables. The operation result of a conditional
expression is "true" (the condition is satisfied) or "false" (the condition is not satisfied).
Use a conditional expression with an "if" or "while" instruction to change the flow of program execution
according to a condition.
Specification format
<variable 1>
=
<variable 1>
<
<variable 1>
<=
<variable 1>
>
<variable 1>
>=
<variable 1>
<>
Note: <variable 1> and <variable 2> can be constants ranging from 0 to 127.
Numeration
Decimal
Decimal number
Hexadecimal
Hexadecimal number (specifiable only in the "Data Window")
Binary
Binary number (specifiable only in the "Data Window")
<variable 3>
<variable 3>
<variable 3>
<variable 3>
<variable 3>
abs
<variable 3>
<variable 3>
<variable 3>
<variable 3>
<variable 3>
not
<variable 3>
<variable 2>
<variable 2>
<variable 2>
<variable 2>
<variable 2>
<variable 2>
Remarks
Addition
Subtraction
Multiplication
Division
Remainder
Absolute value
Substitution
OR (logical addition)
AND (logical product)
XOR (exclusive-OR)
NOT (negation)
"True" when <variable 1> is equal to <variable 2>
"True" when <variable 1> is less than <variable 2>
"True" when <variable 1> is not greater than <variable
2>
"True" when <variable 1> is greater than <variable 2>
"True" when <variable 1> is not less than <variable 2>
"True" when <variable 1> is not equal to <variable 2>
3 - 3
Chapter 3 Syntax
Description
Description

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sj700 series

Table of Contents