![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h-asc02/sysmac-c200h-asc02_operation-manual_742429033.webp)
23
Example: A = 12.3: “12” is assigned to A.
Expressions
Expressions refer to constants, variables, and functions that have been com-
bined by operators. Numeric values, variables, or characters alone can also
form expressions. There are four types of expressions:
•
Arithmetic
•
Relational
•
Logical
•
Character
Of these, the first three produce numeric values as a result and are thus
called “numeric expressions”. The last type is called a “character expres-
sion.”
Arithmetic Operators
An arithmetic expression is made up of constants, variables, and functions
combined using arithmetic operators. A list of valid arithmetic operators is
shown in the following table.
Arithmetic Operator
Example
Operation
+
A + B
Addition
–
A – B, –A
Subtraction or negation
*
A * B
Multiplication
/
A / B
Real number division
\
A \ B
Integer division
MOD
A MOD B
Remainder after integer division
^
A ^ B
Exponentiation
Remarks:
If A or B is a real number in an expression using the \ or MOD operator, the
decimal part is first rounded up to convert the real number into an integer,
and then the operation is performed.
Relational Operators
Relational operators compare two values. The output is “-1” (&HFFFF) if the
two values are equal and “0” if they are not.
Relational Operator
Example
Operation
=
A = B
Equal
<>, ><
A <> B
Not equal
<
A < B
Less than
>
A > B
Greater than
≤
A
≤
B
Less than or equal to
≥
A
≥
B
Greater than or equal to
Character Operator
A character expression is made up of character constants and variables that
are linked with the character operator “+”. Instead of adding characters to-
gether, the “+” operator links the characters together to form one character
value.
Input:
A$=“CF” B$=“BASIC” PRINT A$+“-”+B$
Output:
“CF-BASIC” is displayed.
Logical Operators
Logical Operators perform tests on multiple relations, bit manipulation, or
Boolean operations. The logical operator returns a bitwise result which is ei-
ther “true” (not 0) or “false” (0). In an expression, logical operations are per-
Program Configuration
Section 4-1
Summary of Contents for SYSMAC C200H-ASC02
Page 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Page 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Page 3: ...iv ...
Page 5: ...vi ...
Page 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Page 122: ...Appendix B Specifications 115 130 35 100 5 ...
Page 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...