Okuma OSP-P200L Programming Manual page 287

Hide thumbs Also See for OSP-P200L:
Table of Contents

Advertisement

When new data is assigned to a local variable already registered with other data, that old data is
updated.
Main program
N0010
DIA1 = 160
:
:
:
N0049
N0050
DIA1 = 20
:
:
:
Up to 127 local variables can be used.
When a subprogram call command (CALL statement) is programmed in a main program and
subprogram with local variables set in the block containing the CALL statement, the variables
assigned numeric values in such a block are all registered as new local variables and their
numeric values are stored in memory.
Even when a local variable has the same name as one already registered before the call
statement was programmed, it is registered as a new variable.
Main program
N100 CALL O1000 ABC = 100
&DEF = 150
As shown above, the variables with the same name as ones already registered are registered
anew as different variables.
In N0010, numerical data "160" is assigned to local variable
name "DIA1", and this data remains effective up to sequence
N0049. In N0050, the new numerical data "200" is assigned
to the same local variable name "DlA1". This clears the old
data "160" and replaces it with the new data "200"
O1000
N1050 CALL O2000 ABC = 500
&DEF = 750
Registering local
variable in memory
ABC
100
DEF
150
ABC
500
DEF
750
SECTION 12 USER TASK
Subprogram
Numerical data assigned to
the local variables by the CALL
statement in the main program
Numerical data assigned to
the local variables by the CALL
statement in the subprogram
5238-E P-274
LE33013R0301400120001
LE33013R0301400120002

Advertisement

Table of Contents
loading

This manual is also suitable for:

Osp-p20l-rOsp-p20lOsp-p200l-r

Table of Contents