Local/global variables and flags – IAI America XSEL-QX User Manual

Page 420

Advertising
background image

396

Appendix

13. Local/Global Variables and Flags

Description

Internal variables and flags used in the SEL language are classified into the local type and global type.
Data areas used commonly by all programs are called “Global Areas,” while independent data areas used
only by each program are called “Local Areas.” Global areas must be used when aligning the timings
among multi-tasking programs or allowing these programs to cross-reference the values of their variables.

Example of Use

Handshake between Programs

Program A

Program B

As shown in the above example of two programs, use of global flags enables handshake between the
programs, or specifically allows program B to execute “MOVL 2” after program A has completed the
movement based on “MOVL 1,” and then allows program A to execute “MOVL 3” after the completion of
movement by program B.

Backup by Battery

X-SEL controllers have a built-in battery to retain the conditions of variables and flags used by the
program. With both variables and flags, their conditions will be retained even after the controller power is
cut off, if they are stored in global areas. The conditions of variables and flags saved in local areas will be
cleared (= the variables will return to “0” and flags will turn OFF) when the program is started.

Advertising
This manual is related to the following products: