question

Manoj K3 avatar image
0 Likes"
Manoj K3 asked Joerg Vogel answered

Change global variable

I am trying to change the value of the variables based on the value in the table?

How to change the value of global variable at the model start or model reset ?

FlexSim 20.0.0
global variables
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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered

Hi @Manoj K3, any 3D object has got triggers. One of them is the On Reset trigger. You find additionally such a trigger in the toolbox for the item Modeling Logic> Model Trigger. Unfortunately there isn’t a direct picklist option in the 3D object triggers to manipulate a global variable. You must write source code in the source code editor of the 3D object, which you access by the parchment roll icon, or the OnModelReset Model Triggers. Because the variable is global, you can assign the value directly by the name.

variable1 = 2;

If you want to get a value from a global table assigned into a global variable you get the value by

Table(“Your global table name”)[ num row] [num column]

variable1 = Table(“GlobalTable1”)[1][1];
	

Any names I have used are default values.

5 |100000

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