Change global variable

Change global variable

manoj_k3
Not applicable
3 Views
1 Reply
Message 1 of 2

Change global variable

manoj_k3
Not applicable

[ FlexSim 20.0.0 ]

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 ?

0 Likes
Accepted solutions (1)
4 Views
1 Reply
Reply (1)
Message 2 of 2

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

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.