Numeric Value Variables; Character String Variables; Position Variables - 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.4.16 Numeric value variables

Variables whose names begin with a character other than P, J, or C are considered numeric value variables.
In MELFA-BASIC V, it is often specified that a variable is an numeric value variable by placing an M at the
head. M is the initial letter of mathematics.
Example) M1 = 100
M2! = -1.73E+10
M3# = 0.123
ABC = 1
1) It is possible to define the type of variable by attaching an numeric value type indicator at the end of
the variable name. If it is omitted, the variable type is assumed to be of the single-precision real num-
ber type.
Numeric value type suffix
%
&
!
#
2) Once the type of a variable is registered, it can only be converted from integer to single-precision real
number. For example, it is not possible to convert the type of a variable from integer to double-preci-
sion real number, or from single-precision real number to double-precision real number.
3) It is not possible to add an numeric value type indicator to an already registered variable. Include the
type indicator at the end of the variable name at the declaration when creating a new program.
4) If the value is exceeded during a single precision = double precision execution, an error will occur.
Table 4-6:Range of numeric value variable data
Type
Integer type
Single-precision real number type
Double-precision real number
type

4.4.17 Character string variables

A character string variable should start with C and end with "$." If it is defined by the Def Char instruction, it
is possible to specify a name beginning with a character other than C.
Example) C1$ = "ABC"
CS$ = C1$
Def Char MOJI
MOJI = "MOJIMOJI"

4.4.18 Position variables

Variables whose names begin with character P are considered position variables. If it is defined by the Def
Pos instruction, it is possible to specify a name beginning with a character other than P. It is possible to ref-
erence individual coordinate data of position variables. In this case, add "." and the name of a coordinate
axis, e.g. "X," after the variable name.
P1.X, P1.Y, P1.Z, P1.A, P1.B P1.C, P1.L1, P1.L2
The unit of the angular coordinate axes A, B, and C is radians. Use the Deg function to convert it to degrees.
Example) P1 = PORG
Dim P3(10)
M1 = P1. X
M2 = Deg(P1. A) (Unit: degree)
Deg POS L10
Mov L10
4-142 Detailed specifications of MELFA-BASIC V
Meaning
Integer
Long-precsion real number type
Single-precsion real number type
Double-precsion real number type
Range
-32768 to 32767
-3.40282347e+38 to 3.40282347e+38
-1.7976931348623157e+308 to 1.7976931348623157e+308
(Unit: mm)
Note)
E expresses a power of 10.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents