Epson RC170 Guide de l'utilisateur Page 173

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 312
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 172
6. The SPEL+ Language
6.7.4 Global variables
Global variables can be shared between all functions in a project. The Global instruction is
used to declare a global variable.
To declare global variables in a program, use the Global instruction with the desired
variable type (Boolean, Byte, Integer, Long, Real, Double, String) at the beginning of the
program before any Function statements:
One way to indicate that variables are global is to precede the name with "g_", as shown in
the example below.
Program: MAIN.PRG
Global Integer g_TotalCycles
Function main
Call LoadPart
...
...
Fend
Program: LOADPART.PRG
Function LoadPart
Jump pick
On gripper
Wait .1
Jump place
Off gripper
Wait .1
g_TotalCycles = g_TotalCycles + 1
Fend
For more information, see Data Types.
6.7.5 Global Preserve variables
You can preserve global variable values by using the optional Preserve parameter when
you declare global variables.
Preserved variables are stored in the controller’s SRAM.
If the data type of a preserved variable is changed, or the number of dimensions is changed,
then the variable values will be cleared.
EPSON RC+ 5.0 (Ver.5.4) User's Guide Rev.4 155
Vue de la page 172
1 2 ... 168 169 170 171 172 173 174 175 176 177 178 ... 311 312

Commentaires sur ces manuels

Pas de commentaire