I'm using the eg.globals variables because i understood that these are the variables are accessible between different scripts e.g. i can sheck if the VentMode is activated on a certain shutter from another python script...or did i misunderstand?
well perhaps there is really no need to put OpenGradRuns in the global dict - will correct that
OK, fine, then you should use eg.globals. Variables declared as such are globally accessible in EG
Is using the command
global VariableName
the same as
eg.globals.VariableName
Is not the same, global VariableName is global inside the running script so to say, eg.globals.VariableName is global in EG, also from different scripts.
eg.globals.VariableName stays 'alive' until EG is closed or they are del(eted) on purpose
global VariableName is only 'alive' while your script/code is running
can i also use global VariableName to get value of that variable or is it just for declaring?
This is for 'telling' python that the globally declared variable shall be used instead of creating a new local one
Can you please explain why did you add all the bolded text below to the AddTask and the function definition command? What does it do?
ShutterTimerObj = eg.scheduler.AddTask(5, VentModeDS, VModeDS, OpenGradRuns)
def VentModeDS(VModeDS, OpenGradRuns):
This is when it is needed to send parameters when calling a function. The def VentModeDS(VModeDS, OpenGradRuns): specifies that the function requires two parameters, the eg.scheduler.AddTask(5, VentModeDS, VModeDS, OpenGradRuns) schedules the function to run with the required parameters in 5 seconds.