question

Gerald avatar image
0 Likes"
Gerald asked Arun Kr answered

How do you link string global variables to edit boxes in a dashboard.

I am trying to use a control dashboard and an edit box to set a global string variable. The documentation says I should be able to do so. Only global numeric variables show up as options. Any help is greatly appreciated.

FlexSim 23.1.2
global variableedit box
5 |100000

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

1 Answer

·
Arun Kr avatar image
1 Like"
Arun Kr answered

Here's a sample model. First, you need to set the global variable as a string type.


1686030778877.png


Link the edit button to the global variable node in the model tree under the tools parent node. When linking using the sampler, it will not show the path till the end data node. You need to manually add the path, as shown in the pic below.

1686030916373.png


Then in the on-apply trigger of the edit button you need to execute either one of the following codes

treenode link = node("..>objectfocus+", c); // link variable to the treenode
Variable1 = link.value;//Updating the global table value

or

treenode link = node("..>objectfocus+", c);// link variable to the treenode
refreshglobalvariables();// command to refresh all global variable

This will update the string global variable, whatever values you insert in the edit field.

Regards,

Arun KRUpdateDashboard_String_GV.fsm



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.