Can I add a variable/ global table value to Exception Limit of Zone Parition?

Can I add a variable/ global table value to Exception Limit of Zone Parition?

jkhedekar
Enthusiast Enthusiast
556 Views
6 Replies
Message 1 of 7

Can I add a variable/ global table value to Exception Limit of Zone Parition?

jkhedekar
Enthusiast
Enthusiast

I would like to add a variable or global table value to the limit column in exception of partition of zone block. Is there a way to do this?

jkhedekar_0-1752518593830.png

 

Using FlexSim - 23.0

0 Likes
Accepted solutions (2)
557 Views
6 Replies
Replies (6)
Message 2 of 7

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

The exceptions table is stored as a node table in the zone's attribute tree.

moehlmann_fe_1-1752561430923.png

 

 

Knowing this you have a lot of options of how to vary the values in the table.

- Create a global table and copy its values over to the zone in its On Reset trigger.

 

Table current = param(1); //Table node

Object zone = Model.find("Tools/ProcessFlow/ProcessFlow/Zone");
Table exceptions = zone.find(">variables/partitionConstraints/1/exceptionTable");
for(int row = 1; row <= current.numRows; row++)
{
	exceptions[row][2] = current[row][2];
}

 

 

- Toggle the "Limit" nodes as FlexScript and make them return a table value, global variable or parameter. "Limit1" is a global variable in the screenshot below.

 

moehlmann_fe_2-1752561452270.png

 

- Link a "Passthrough" parameter to the nodes so that changing the parameter is the same as changing the node's value.

 

moehlmann_fe_0-1752561357724.png

 

 

Message 3 of 7

jkhedekar
Enthusiast
Enthusiast

Perfect! This worked flawlessly. Thanks for sharing.

0 Likes
Message 4 of 7

jkhedekar
Enthusiast
Enthusiast

@FelixMoehlmannif I do it through reset trigger, in which I also added on reset to use parameters to set to these global table which then sets to these partition zone. It doesn't seem to work with experimenter in my case. 

 

My guess is because its on reset it doesn't work with experimenter. How can I work around this?

0 Likes
Message 5 of 7

FelixMoehlmann
Collaborator
Collaborator

Could be that setting the parameter and executing the reset are happening in the wrong order. If you place the code in the On Set trigger of the last parameter that is used for setting the table it should work.

0 Likes
Message 6 of 7

jkhedekar
Enthusiast
Enthusiast

Do you mean adding the on-reset code to trigger here?

jkhedekar_0-1752674648410.png

 

0 Likes
Message 7 of 7

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

No I mean the On Set trigger of the parameters in the parameter table. They get executed from top to bottom. So if you place the code that updates the table in the last parameter all values should be set correctly when the update happens.

moehlmann_fe_0-1752731159403.png