EasyManua.ls Logo

Hitachi SJ700-2 Series - Operators; Conditions

Hitachi SJ700-2 Series
134 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 3 Syntax
3 - 3
(2) Numeric notation
Notation Numeration Remarks
(Omitted) Decimal Decimal number
&H Hexadecimal Hexadecimal number (specifiable only in the "Data Window")
&B Binary Binary number (specifiable only in the "Data Window")
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 Description
<variable 1> = <variable 2> + <variable 3>
<variable 1> = <variable 2> - <variable 3>
<variable 1> = <variable 2> * <variable 3>
<variable 1> = <variable 2> / <variable 3>
<variable 1> = <variable 2> mod <variable 3>
<variable 1> = abs <variable 3>
<variable 1> = <variable 3>
<variable 1> = <variable 2> or <variable 3>
<variable 1> = <variable 2> and <variable 3>
<variable 1> = <variable 2> xor <variable 3>
<variable 1> = not <variable 3>
Addition
Subtraction
Multiplication
Division
Remainder
Absolute value
Substitution
OR (logical addition)
AND (logical product)
XOR (exclusive-OR)
NOT (negation)
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 Description
<variable 1> = <variable 2>
<variable 1> < <variable 2>
<variable 1> <= <variable 2>
<variable 1> > <variable 2>
<variable 1> >= <variable 2>
<variable 1> <> <variable 2>
"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>
Note: <variable 1> and <variable 2> can be constants ranging from 0 to 127.

Table of Contents

Related product manuals