Priority and randomness in channels, blocked transporter

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Melrokien
Posts: 2
Joined: Thursday 03 April, 2014 - 15:11

Priority and randomness in channels, blocked transporter

Post by Melrokien »

Hello,

I have got sort of stuck with my model and every piece of advice would be very welcome.

I have 12 machines divided in 3 three groups (nests). When a product is conveyed from the warehouse it should check 1-2 prioritized servers first, if they are busy. If so, check the others and randomly send it to one of them. If all servers are busy, it should check if the rollers are full (again 1-2 prioritized rollers first and then the rest, same principle as before). In case everything is busy or full, the product shall wait on the conveyor, till something becomes free.
For the last feature I tried to use function “wait” and it didn’t really work for me.
After processing in one of the server (e.g. in nest1), the product’s color is changed and it is conveyed along the other nests to the sink.

In the nest there is an advanced transporter which works as bidirectional conveyor with capacity of one product. The advanced option is to have capacity of 2 in case both products are travelling the same direction.
In the model there is only one nest for now, the other ones will be connected after conveyor2 (destination 5) in the same fashion as nest1.

On exit trigger of the conveyor where advanced transporter picks up the products I have following script:
if(
icopen(1,atombyname([Navijecka1],Model))=1,Setlabel([destination],1,i),
if(
icopen(1,atombyname([Navijecka2],Model))=1,Setlabel([destination],2,i),
if(
icopen(1,atombyname([Navijecka3],Model))=1,Setlabel([destination],3,i),
if(
icopen(1,atombyname([Navijecka4],Model))=1,Setlabel([destination],4,i),
if(
content(atombyname([Roller1],Model))=0,Setlabel([destination],1,i),
if(
content(atombyname([Roller2],Model))=0,Setlabel([destination],2,i),
if(
content(atombyname([Roller3],Model))=0,Setlabel([destination],3,i),
if(
content(atombyname([Roller4],Model))=0,Setlabel([destination],4,i),

setlabel([destination],5,i)
))))))))

I cannot really include the randomness in choosing servers, although the priority is marginally there, so I think there must be more elegant way to do it.
One last question – when a product gets to the exit of conveyor1 and gets information that roller3 is free, but the transporter is just on its way delivering there a previous product. The transporter gets blocked, any idea how to prevent this?

I know it is a lot of questions at once, but even small hints may be a great help to me :-)?
Attachments
Navijarna06.mod
(59.65 KiB) Downloaded 315 times
SimonvdW
Posts: 47
Joined: Thursday 06 January, 2011 - 09:52

Re: Priority and randomness in channels, blocked transporter

Post by SimonvdW »

Hi,

A reply on your questions, including model.

I added a Condition controller which checks whether alle rollers are full. If so it blocks the conveyor 1, if not it keeps it openend. This prevends the system from being blocked, then the transporter is not loaded when no destination is available.
I also changed colors to show that products are processed.

For the destination assignment on the conveyor I used a global reference (set in the Initialize atom). The function checks in the order from 1 to 4 whether a machine is available or - if not - whether a roller is available .
Some explanations are added as text in the code itself.

Hopefully this helps you.

Regards,
Simon
Attachments
Navijarna07_Inc.mod
(63.02 KiB) Downloaded 313 times
Melrokien
Posts: 2
Joined: Thursday 03 April, 2014 - 15:11

Re: Priority and randomness in channels, blocked transporter

Post by Melrokien »

Thank you a lot Simon,

it was helpful and it gave me some more ideas how to continue. You actually managed to answer my questions exactly on my Birthday :-)
Post Reply