Cancel
Showing results for 
Search instead for 
Did you mean: 

FLOW CONTROL PROBLEM

Creator
Creator

Hi to all.

I'm a Plant Simulation new user and I need your help.

 

I have to model two lines, one with empty pallets flowing and one with entities on pallets (full pallets created with the transfer station)...then these two lines are connected to one line on which both empty and full pallets flow.

This unique line must be split again into full and empty pallets and I decided to use the FLOW CONTROL block with exit strategy Method and with this code which doesn't work:

 

(r : integer) : integer
is
do
if @.name="Entity" then
return 1;
else
return 2;

end;

end;

 

What's the name of a Pallet+Entity?

Is it a correct strategy?

 

Thank you

14 REPLIES

Re: FLOW CONTROL PROBLEM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

in your case @ is the pallet, this could be empty or occupied:

 

(r : integer) : integer
is
  do
  if @.occupied=true then
     return 1; --filled pallets
  else
     return 2;--empty pallets

  end;

end;

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: FLOW CONTROL PROBLEM

Creator
Creator

Thank you very much...now it works well!

 

I have two other questions:

 

1) what is the right method for a flow control (2 IN 1 OUT) which makes pass the first object arriving but in case of same time arrival makes pass object #1 for example?

 

2)I have one line (which works as a buffer) linked to three lines with one station each at the end. I'd like to make flow out of the first line an entity only if stations need one.

This means that one of the three stations calls, only one entity flows out even if during this time the station is "yellow and it's waiting the entity arrival.

 

Sorry for all these questions but I need your help!

Thank you!

 

Re: FLOW CONTROL PROBLEM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I do not know, what you are meaning with 1)

 

2) You could wait at the end of the line, until one station and the connected line are not occupied:

 

waituntil (station1.occupied=false and line_station1.occupied=false) or
(station2.occupied=false and line_station2.occupied=false) or
(station3.occupied=false and line_station3.occupied=false) prio 1;
if (station1.occupied=false and line_station1.occupied=false) then
@.move(line_station1);
elseif (station3.occupied=false and line_station3.occupied=false) then
@.move(line_station2);
else
@.move(line_station3);
end;

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: FLOW CONTROL PROBLEM

Creator
Creator

With 1) I mean, flow control linked to 2 lines input and 1 line output; actually a node where the first entity entering exits first but, in the unlucky case of two entity entering at the same time (one from line 1 and one from line 2), entity from line 1 must exit first.

 

2) Do I have to write this method for the line property--->Controls--->Exit?

I tried this but it doesn't work 

Re: FLOW CONTROL PROBLEM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

to 1) try the Entry Strategy cyclic non blocking, this should work

 

to 2) a little mistake in my method, should be:

is
do
 waituntil (station1.occupied=false and line_station1.occupied=false) or
   (station2.occupied=false and line_station2.occupied=false) or
   (station3.occupied=false and line_station3.occupied=false) prio 1;
if (station1.occupied=false and line_station1.occupied=false) then
  @.move(line_station1);
elseif (station2.occupied=false and line_station2.occupied=false) then
  @.move(line_station2);
else
  @.move(line_station3);
end;
end;

see also the attachment

 

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: FLOW CONTROL PROBLEM

Creator
Creator

First of all, thank's for you help Steffen_B!

 

I opened your example and it works well but my model doesn't, I add my model.

 

Line 2 should act as a buffer and when OP10 or OP20 or OP30 call (when they finish to work), a pallet must flow from Line 2 to Line3 or Line5 or Line52 where the pallet is loaded.

I can't control Line2 Exit and the pallet flow (if empty pallet is called from OP20 it must go to Line5 and not to Line3 or Line 52).

 

Thank you

Re: FLOW CONTROL PROBLEM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

what is the content of line2.onExit (I cannot look into your methods)?

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: FLOW CONTROL PROBLEM

Creator
Creator

It is in "User-defined attributes" of Line2:

 

is
do
waituntil (OP10.occupied=false and Line3.occupied=false) or
(OP20.occupied=false and Line5.occupied=false) or
(OP30.occupied=false and Line52.occupied=false) prio 1;
if (OP10.occupied=false and Line3.occupied=false) then
@.move(Line3);
elseif (OP20.occupied=false and Line5.occupied=false) then
@.move(Line5);
else
@.move(Line52);
end;
end;

Re: FLOW CONTROL PROBLEM

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

it can not work, you can not wait e.g. for op10.occupied=false if you want to send a pallet for loading fron this place. And why you want to wait for e.g. OP30.occupied=false?

 

The condition should be: wait for a part on OP10 and no pallet on the way.

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net