User Manual

GETTING STARTED


OTHER EDITIONS


LAUNCHERS


MODULES


PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support

ALL USER MANUAL VERSIONS

Ignition 8.1. Offline Version (04/2021)
Ignition 8 Online Version
Ignition 7.9 Online Version
Ignition 7.8 Online Version

Deprecated Pages

SDK Documentation

Employees

Sign In

Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

This method returns a dictionary that provides access to the legacy global namespace. As of version 7.7.0, most new scripts use the modern style of scoping, which makes the 'global' keyword act very differently. Most importantly, the modern scoping rules mean that variables declared as 'global' are only global within that one module. The system.util.getGlobals() method can be used to interact with older scripts that used the old meaning of the 'global' keyword.

The following feature is new in Ignition version 8.1.0
Click here to check out the other new features

The globals dictionary will now persist across the lifetime of the JVM, and it's now accessible at system.util.globals

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.util.getGlobals()

  • Parameters

Nothing

  • Returns

Dictionary[String, Any] The global namespace, as a dictionary.

  • Scope

Gateway, Vision Client, Perspective Session

Code Examples
Code Snippet
# Read and print out global variable 'foo'.
print system.util.getGlobals()['foo']

Code Snippet
 # Write value 'hello' to global variable 'foo'.
system.util.getGlobals()['foo'] = 'hello' 
Keywords

system util getGlobals, util.getGlobals