Cancel
Showing results for 
Search instead for 
Did you mean: 

Use global variable in a hierarchy

Experimenter
Experimenter

Hi everybody,

 

I have a question regarding the usage of global variables in a hierarchical network:

I'm simulating a supply chain in a network which consists of different sub-networks (e.g., production site 1, production site 2 etc). I defined in the supply chain network a global variable and some methods. Can I use these global variables and the methods also in the sub-networks? Or are they only global in each network? If I can use them, how can I do it?

 

Thanks for the answers!

best,

berndt

3 REPLIES

Re: Use global variable in a hierarchy

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi berndt2002,

 

you can access an object Variable, which is located in an arbitrary network (object Frame).

For instance:

 root.Frame.variable := 10;
 local n := root.Frame.variable;
 print n;

 

Note that root is your simulation frame, which containes the Eventcontroller.

 

Regards,

Peter

Re: Use global variable in a hierarchy

Experimenter
Experimenter

Hi, I often drag and drop a variable in the Class library to use as a "global" variable.

 

In this case very easy to access it from any of the frames.

 

myglobalvariable.png

 

Regards,

Zsolt

Re: Use global variable in a hierarchy

Experimenter
Experimenter

Hi guys,

 

thank you very much for you responses. That helped and I resolved the issue...

 

Thanks and best!!!