<9. Advanced Engineering >
157
TI 34P02K35-02E May 31, 2017-00
9.1.2 Local Variables versus Global Variables
When creating an application, local variables and global variables can be defined.
This section describes the differences between local variables and global variables,
some precautions when defining local variables and global variables, the
relationship between device label variables and global variables and other topics.
● Differences between Local Variables and Global Variables
Local variables can only be used within the logical POU in which it is defined. Global
variables, on the other hand, can be used in all logical POU.
The figure below shows four created logical POUs, namely, Main, LogicA, LogicB
and LogicC and three code worksheets, namely, LogicA1, LogicA2 and LogicA3,
created within LogicA.
Local variables defined on LogicA’s variable worksheet can be used only within the
LogicA logical POU, that is, within any of the three code worksheets LogicA1,
LogicA2 and LogicA3 but not within Main, LogicB and LogicC.
Similarly, a local variable defined on the variable worksheet of Main, LogicB or
LogicC can only be used within the logical POU in which it is defined.
On the other hand, global variables defined on the variable worksheet for global
variables can be read and written in any of the Main, LogicA, LogicB and LogicC
logical POUs.
Summary of Contents for STARDOM FCN-500
Page 2: ...Blank Page...
Page 10: ...Blank Page...
Page 32: ...Blank Page...
Page 36: ...TI 34P02K35 02E Jun 6 2018 00 Blank Page...
Page 76: ...TI 34P02K35 02E Jun 6 2018 00 Blank Page...
Page 163: ...Blank Page...
Page 221: ...Blank Page...
Page 225: ...Blank Page...