User-Defined External Variables - Mitsubishi Electric CR750-Q Instruction Manual

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

Advertisement

4.4.24 User-defined external variables

If the number of program external variables listed above is insufficient or it is desired to define variables with
unique names, the user can define program external variables using a user base program.
1) First, write a user base program. Use "_" for the second character of the variables.
2) Register the program name in the "PRGUSR" parameter and turn the power off and on again.
3) Write a normal program using the user-defined external variables.
(1) By defining a variable having an underscore (_) for the second character of the identifier with the DEF
statement in the user base program
(2) It is not necessary to execute the user base program.
(3) Write only the lines necessary for declaring variables in the user base program.
(4) If it is desired to define array variables in a user base program and use them as external variables, it
is necessary to declare them using the Dim instruction again in the program in which they will be
used. It is not necessary to declare local variables (variables valid only within programs) again.
Example) Example of using user-defined external variables
On the main program (program name 1) side
10 Dim P_200(10)
20 Dim M_200(10)
30 Mov P_100(1)
40 If M_200(1) =1 Then Hlt
50 M1=1
On the user base program (program name UBP) side
10 Def Pos P_900, P_901, P_902, P_903
20 Dim P_200(10)
30 Def Inte M_100
40 Dim M_200(10)
Parameter name
PRGUSR
Procedure before using user-defined external variables
Note)
' Re-declaration of external variables
' Re-declaration of external variables
' Local variable
, that variable will be handled as an external variable.
' It is necessary to declare this variable again in the
program in which they will be used.
' It is necessary to declare this variable again in the
program in which they will be used.
Value
UBP
Detailed specifications of MELFA-BASIC V 4-145
4MELFA-BASIC V

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents