Nick Mudge Ignition Software Consulting & Development

GStore was some functionality I built into the Power Scripting module. It developed over a short time and now I think it is best to get rid of it.

GStore is short for global storage. It was a way to store global data in Python variables in Ignition projects. The main problem with it is that there is already a great way to do it -- just store global data in Python project modules. I thought I could add various functionality to gstore to make it more unique and useful. But I found that I could add the same functionality in more general ways.

GStore still exists in the Power Scripting module for backwards compatibility but I removed it from Power Scripting documentation and its use is no longer recommended.

GStore answered this question very clearly: "How can I store and use data globally in an Ignition project in a very flexible and dynamic way during runtime in an Ignition client?" But the best answer is use a Python module library; create a module level variable and functions for setting and accessing it, then use those functions in your application to store and manipulate global data.

Here is a simple example:

#project.machines Python module
#create module level variable
_machineConfig = {}
#create functions for setting and getting machines that can be used anywhere in the project
def addMachineConfig(machineID, config):
    _machineConfig[machineID] = config

def getMachine(machineID)
    return _machineConfig[machineID]

I really want to build new and useful things into the Power Scripting module, so let me know what you want.

Comments

Doris K. Foulds
www.essaysontime.com.au/assignment/
18 October 2018

As, this python language is not in use by many companies designing or using the software which are run by this language were been stopped and most of the blogs are using oops concept languages than this language. Other companies they have started to use other language coded platform for their work purposes.
Name: (required)
Email: (required)
Website:
What has four legs, rhymes with bat and says, "Meow?" (One word answer.)
Spam Filter: