Expressions And Operations; List Of Operator - Mitsubishi Electric CR750-Q Instruction Manual

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

4MELFA-BASIC V

4.1.6 Expressions and operations

The following table shows the operators that can be used, their meanings, and statement examples.

(1) List of operator

Class
Operator
Substituti
=
on
Numeric
+
value
operation
-
*
/
^
\
MOD
-
Comparis
=
on
operation
<>
or
><
<
>
=<
or
<=
=>
or
>=
4-120 MELFA-BASIC V functions
Meaning
Statement example
The right side is
P1=P2
substituted in the left
P5=P_Curr
side.
P10.Z=100.0
M1=1
STS$="OK"
Add
P10=P1+P2
Mov P8+P9
M1=M1+1
STS$="ERR"+"001"
Subtract
P10=P1-P2
Mov P8-P9
M1=M1-1
Multiply
P1=P10*P3
M1=M1*5
Divide
P1=P10/P3
M1=M1/2
Exponential operation M1=M1^2
Integer division
M1=M1\3
Remainder operation
M1=M1 Mod 3
Sign reversal
P1=-P1
M1=-M1
Compare whether
If M1=1 Then *L1
equal
If STS$="OK" Then *L2
Compare whether not
If M1<>2 Then *L3
equal
If STS$<>"OK" Then *L4
Compare whether
If M1< 10 Then *L3
smaller
If Len(STS$)<3 Then *L4
Compare whether
If M1>9 Then *L3
larger
If Len(STS$)>2 Then *L4
Compare whether
If M1<=10 Then *L3
equal to or less than
If Len(STS$)<=5 Then *L4
Compare whether
If M1=>11 Then *L3
equal to or more than
If Len(STS$)>=6 Then *L4
'Substitute P2 in position variable P1.
'Substitute the current coordinate value in current position variable P5.
'Set the position variable P10 Z coordinate value to 100.0.
'Substitute value 1 in numeric variable M1.
'Substitute the character string OK in the character string variable
STS$.
'GSubstitute the results obtained by adding the P1 and P2 coordinate
elements to position variable P10.
'Move to the position obtained by adding the position variable P8 and
P9 coordinate elements.
'Add 1 to the numeric variable M1.
'Add the character string 001 to the character string ERR and
substitute in character string variable STS$.
'Substitute the results obtained by subtracting the P2 coordinate
element from P1 in position variable P10.
' Move to the position obtained by subtracting the P9 coordinate
element from the position variable P8.
'Subtract 1 from the numeric variable M1.
'Substitute the relative conversion results from P10 to P3 in position
variable P1.
'Multiple the numeric variable M1 value by 5.
'Substitute the reverse relative conversion results from P10 to P3 in
position variable P1.
'Divide the numeric variable M1 value by 2.
'Square the numeric variable M1 value.
'Divide the numeric variable M1 value by 3 and make an integer
(round down).
'Divide the numeric variable M1 value by 3 and leave redundant.
'Reverse the sign for each coordinate element in position variable P1.
'Reverse the sign for the numeric variable M1 value.
'Branch to step *L1 if numeric variable M1 value is 1.
'Branch to step *L2 if character string in character string variable STS$ is
OK.
'Branch to step *L3 if numeric variable M1 value is 2.
'Branch to step *L4 if character string in character string variable STS$
is not OK.
'Branch to step *L3 if numeric variable M1 value is less than 10.
'Branch to step *L4 if No. of characters in character string STS$
variable is less than 3.
'Branch to step *L3 if numeric variable M1 value is more than 9.
'Branch to step *L4 if No. of characters in character string variable
STS$ is more than 2.
'Branch to step *L3 if numeric variable M1 value is equal to or less
than 10.
'Branch to step *L4 if No. of characters in character string variable
STS$ is equal to or less then 5.
'Branch to step *L3 if numeric variable M1 value is equal to or more
than 11.
'Branch to step *L4 if No. of characters in character string variable
STS$ is equal to or more than 6.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents