beautypg.com

Local/global variables and flags – IAI America PSEL User Manual

Page 297

background image




287

Part 2 Programs

13. Local/Global Variables and Flags


Description


The internal variables and flags used in the SEL language are classified into local and global types.
The data range used commonly by all programs is called the global range, while the data range used only
by each program is called the local range. When multi-tasking programs are run simultaneously, the
global range must be used to synchronize the programs and allow cross-referencing of variables among
the programs.

Example of Use


Program handshake

Program A

Program B














Use of global flags with the above two programs permits handshake between the programs, and the
actuator moves per “MOVL 1” in program A, moves per “MOVL 2” in program B, and then move per
“MOVL 3” in program A, for example.

Backup in Battery


If the PSEL controller has a built-in battery (optional), variables and flags used in the programs are
retained. For both variables and flags, only those in the global area will be retained after the controller
power is cut off.
The variables and flags in the local range are cleared when the program is started (the variables are reset
to “0,” while the flags turn OFF).