question

Manocher Djassemi avatar image
0 Likes"
Manocher Djassemi asked Manocher Djassemi commented

Conditional Port

@Ben Wilson

I am using conditional port in a Separator. I have entered:

content(node("Rack1", model())) <=30

If True Port 1 If False Port 2

The Separator is connected to Rack1 (port 1) and a queue (port 2).

When I run the model, all items flow to Rack1, none goes to queue even when <=30 condition is met as can be observed. Any solution will be appreciated.

Manocher

ports control
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

@Manocher Djassemi,

That code should have worked, assuming your rack is named "Rack1".

Can you attach your model?

0 Likes 0 ·
Manocher Djassemi avatar image Manocher Djassemi commented ·

I am using the following codes in Flow tab of a Separator. Port 1,2,and 3 are connected to 3 racks.

While the first IF condition sends item 9 to port 2, the second one does not send the item 8 to port 3. It keep sending it to port 1. I ran the model long enough to make sure the condition >=5 is met. Is there anything wrong with these codes? Thanks

if(content(outobject(current,1)) >= 5&&getitemtype(item)==9) {

return 2;

if(content(outobject(current,1)) >= 5&&getitemtype(item)==8) {

return 3;

} else {

return 1;

}}

0 Likes 0 ·

1 Answer

·
Cameron Pluim avatar image
2 Likes"
Cameron Pluim answered Ben Wilson commented

If the Rack is connected to outport 1, you could use the following:

if(content(outobject(current,1)) <= 30) {
	return 1;
} else {
	return 2;
}
· 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.

Manocher Djassemi avatar image Manocher Djassemi commented ·

That solved the problem. Thanks

0 Likes 0 ·

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.