question

Patrick Zweekhorst avatar image
1 Like"
Patrick Zweekhorst asked Patrick Zweekhorst commented

How to set text reference in Model parameters table?

Hi,

We have an older model that is updated to FlexSim 21.1, with the new parameters table.
This all works fine until we wanted to add some text fields to the experimenter. The model uses the Excel import to import the settings and data into some global tables. So, these global tables contain all the information that should also be used in the experimenter.

The first problem shows when we want to sample a cell in a global table that contains string data. We have added a parameter to the model parameters table and set the type to expression. Then click on the sampler and try to sample the text field. This does not seem to be possible, only number fields are allowed to be sampled.

So what we did is to change the data type of the global table cell to number data and sampled that cell and selected Set Node Value. Now we can set the value in the model parameters table using the quotes “”. Pressing reset does set the cell in the global table, but also with quotes:

1626079279274.png

This can of course be fixed by overwriting the OnSet in the model parameters table, but this is a bit difficult for our customer.

What are the correct steps to use text parameters in the experimenter with the new Model parameters structure? The steps above do not seem like the optimal thing to do, so we hope there is a simpler solution to this.


Thank you for any ideas or solutions,

Patrick

FlexSim 21.1.4
global tableexperimenttextmodel parameters
1626079279274.png (14.2 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

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Patrick Zweekhorst commented

In version 21.0 or 21.1, the correct way for text is to use an Option parameter. The Option parameter allows you to specify a list of possible values for a parameter. When you set the value of the parameter, you use a number to indicate the nth possible value. If the values are strings, you should also be able to set the parameter to the string value. When you get the parameter value, you'll get the string value.

So you'll still need your workaround to get the sampler to work (I'll add that to the dev list), where you set the table cell to number data, and then sample it. But After that, the parameter will happily set the table cell to string data with no quotes.

OptionParameterForStringVals.fsm

In version 21.2, you'll have the option to create a Pass-Through parameter. This kind of parameter looks at an arbitrary node. When you get the parameter's value, it actually gets the value from the other node, and when you set the value, it sets the value on the other node. Then you can use the Global Table interface to set the parameter's value, and vice-versa.


· 1
5 |100000

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

Patrick Zweekhorst avatar image Patrick Zweekhorst commented ·
Hi @Jordan Johnson ,

Thank you for the reply, we already noticed the change in 21.2 and that looks really helpful. The option parameter could also be useful, although that will be a bit hard to combine with the data being imported from Excel.

0 Likes 0 ·