question

anon-user avatar image
0 Likes"
anon-user asked tannerp commented

open and close ports based labels in custom code

Hi all,

please find attached my simplified model.

The goal of this simulation is to water plants 3 times a day. In order to check if plants (in this case palets) need water I am asigning a label called NeedWater. At the beginning (in the morning) the plants are loaded on the red conveyor and NeedWater is set at 0. The decision point checks wether NeedWater is 1 or 0. If it's 1, the red conveyor ouput port is being openend in a costum code. There are 3 operational times a day during which the plants are watered. During these operational times NeedWater is set to 1 in order for the shuttle to loop the plants through the blue conveyor. Once one loop is done, the label is set to 0 again. This is also done by the custom code "on down" in time tables.

Problem: When NeedWater is equal to 1 the port opens (this seems to be working) but lets only one flowitem through and the rest stops.

FlexSim 18.1.2
portstime tablescostum code
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

·
David Chas avatar image
0 Likes"
David Chas answered

Hi!!

The problem in your model is that the close output function in the decision point DP2 "on arrival" is evaluated per each item before change the label NeedWater, and then, when you open the port in "Ondown" function, the model only open the port for one item. In my opinion, you can use a conveyer with a limit of one item to solve the problem.

I attached a model with the solution explained. I hope this model is usefull for you!!


5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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