question

Talia Z avatar image
0 Likes"
Talia Z asked tannerp edited

Control process using queue size

I would appreciate help fixing my control logic. When the truck enters "Combiner 1" it will closeinput on the separator. When the "Bottles" queue > 90, I aim to send a message to "Queue2". On this message, "Queue2" will closeoutput. Then, OnExit of "Queue2" the separator will openinput. I believe I need to openoutput on my "Queue2", but am not sure how to do this without disturbing the other logic.

My aim is to control when the separator gets a new truck based on two parameters; both of these need to be satisfied for the separator to receive a new truck. (1) "Bottles" queue size < 90 and (2) "Combiner1" is empty

Is there a better way to do this using only a send message control on the "Bottles" queue? I am not sure how I would write the (2) parameter. Thank you very much for your help!

bottle-unloader-process-v8.fsm

FlexSim 17.2.5
message triggercontrolqueue size
queue-2.png (90.2 KiB)
combiner1.png (102.2 KiB)
queue2-2.png (86.8 KiB)
· 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.

Talia Z avatar image Talia Z commented ·

@Joshua S -- I have tried a different method to solve the issue I posted about in the previous question

0 Likes 0 ·

1 Answer

tannerp avatar image
0 Likes"
tannerp answered tannerp edited

I would use the following code for the second parameter in your question. I'm not sure the timing of everything and if it's all going to work, but hopefully this helps get you started.

model().find("Combiner1").as(Object).subnodes.length == 0<br>
· 2
5 |100000

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

Talia Z avatar image Talia Z commented ·

@Tanner Poulton Thank you, that's very helpful! If I send a message and use your code and the code below as parameters, will that ensure that the message is only sent when both parameters are met? Also, would you mind telling me if the code written below is correct?

model().find("Bottles").as(Object).subnodes.length<90
0 Likes 0 ·
Jeff Nordgren avatar image Jeff Nordgren Talia Z commented ·
@Talia Z

The code you wrote appears to be syntactically correct. It seems like it would be part of an "if" statement or similar? The code would return the Object Bottles and check to see if Bottles has a content less than 90. The way you use the code in your model may or may not work, depending on how your code is used, specifically.

Thanks.

0 Likes 0 ·