question

Jon Abbott avatar image
1 Like"
Jon Abbott asked Jon Abbott answered

Global variable not updating properly from Dashboard combobox

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

FlexSim 20.0.2
comboboxglobal variable
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered tannerp converted comment to answer

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.
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jon Abbott avatar image Jon Abbott commented ·

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.

1 Like 1 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Jon Abbott commented ·

Yeah, that's a good idea.

0 Likes 0 ·
Jon Abbott avatar image
1 Like"
Jon Abbott answered

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.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.