question

Jackie Ho avatar image
0 Likes"
Jackie Ho asked Adrian Haws edited

How to control "State Pie" chart time from global table

Hi, Flexsim support team,

As attached picture shows, if I’d like to one cell of Global table to control From Time column of state pie, kindly advise how to do this function, thanks.

FlexSim 16.1.0
global tabledashboardscommands
picture.png (31.8 KiB)
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

Sam Stubbs avatar image
1 Like"
Sam Stubbs answered Sam Stubbs edited

So you can do this by adding an OnModelReset trigger to your model. In the Toolbox tab (next to the Library tab on the left of the screen) Using the green 'plus' drop down you can select Modeling Logic > Model Trigger > On Reset. If you open up that trigger, you can add a code that looks something like this:

setvarnum(node("/Tools/Statistics/State Analysis",model()),"mincollecttime",gettablenum("GlobalTable1",1,1));

Where the first parameter of the node() function is a path to the State Pie you want to reference. (You can look this up in the model's Tree window.) and the gettablenum() function is referencing the Global Table you want to look up, and the row and column of that table that you want to reference.

This should make it so that every time you reset the model, that mincollecttime variable/field will update with whatever value you added to the Global Table cell.

5 |100000

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