Global variable not updating properly from Dashboard combobox

Global variable not updating properly from Dashboard combobox

jon_abbott
Not applicable
627 Views
4 Replies
Message 1 of 5

Global variable not updating properly from Dashboard combobox

jon_abbott
Not applicable

[ FlexSim 20.0.2 ]

In working with an example model that was posted here, I'm noticing strange behavior with FlexSim 20.0.2... it updates the Global Variable value if I set it using a combobox and then request its value in the Script Console, but the value doesn't change in the Global Variable entry in the Toolbox. Please see the attached video for reference. Is there something else that needs to be done to update the Global Variable value in the Toolbox? Thanks in advance for your help.

global-variable-not-updating.zip

Accepted solutions (1)
628 Views
4 Replies
Replies (4)
Message 2 of 5

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

That field in the toolbox is the initial value, not the current value. It says this in the tooltip and the user manual (https://docs.flexsim.com/en/20.0/Reference/Tools/GlobalVariables/😞

Values Shown are Initial Values
The value shown is the initial value of the variable. It is not the current value of the variable. The current value of the variable is stored in memory and can be seen by returning it in a script window or printing it from somewhere in code. The current value is not stored in the model tree anywhere. Global variable values are reset when you open the model, reset or compile.


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 5

jon_abbott
Not applicable

Thanks @Matthew Gillespie. Could I suggest a minor change to the wording of the Global Variable Toolbox window so that it says "Initial Value" instead of just "Value" next to the value box? That would make it more obvious for those of us who didn't happen to catch it in the tooltip or User Manual. Thanks again.

Message 4 of 5

Matthew_Gillespie
Autodesk
Autodesk

Yeah, that's a good idea.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 5 of 5

jon_abbott
Not applicable

For anyone who is wanting to change the initial value of the Global Variable (i.e. what is shown in the Toolbox) using an editable text box, please refer to the answers in this post. This is ultimately what I ended up doing instead of using a combobox.