Reading labels with the assembler

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Maaike8
Posts: 3
Joined: Tuesday 17 April, 2018 - 11:20

Reading labels with the assembler

Post by Maaike8 »

Hello,

I am currently modeling a situation of a food bank and I have a question about the assembler I am using. The food bank has to make 2000 crates each week and for these crates they need at least 12000 products. For this model I have incoming food donations that contain a label 'products on pallet', that tells how much products a specific donation contains. I want my assembler to select products based on the number of 'products on pallet' and not the products separately. So, when the order says that 12000 products are needed for a specific week, the assembler needs to count the 'products on pallet' for specific products until there are 12000 or more.
I hope this is a clear problem; is there someone who can help me with this?

Kind regards,
Maaike
User avatar
Gerben
Posts: 9
Joined: Monday 30 April, 2018 - 09:48

Re: Reading labels with the assembler

Post by Gerben »

Hi Maaike,

I see two solutions for your problem:
a) Model donations as pallets that you unpack, your assembler then uses the count of unpacked items.
b) Create your own variant of an assembler, that uses an other counting mechanism.

For option b), you may want to take a look at the 4dScript at Assembler->OnEntered. The last bit of code shows under which conditions the assembler packs the products.

Gerben
Maaike8
Posts: 3
Joined: Tuesday 17 April, 2018 - 11:20

Re: Reading labels with the assembler

Post by Maaike8 »

Hi Gerben,

Thanks for your quick response. Only thing is that I am not very experienced with ED yet, so can you explain a bit more how to model donations as pallets that need to be unpacked?

Regards, Maaike
User avatar
Gerben
Posts: 9
Joined: Monday 30 April, 2018 - 09:48

Re: Reading labels with the assembler

Post by Gerben »

You can create a source that creates a container with 'x' products inside, instead of creating a label 'products on pallet' with value 'x'.
You can then use a splitter or unpacker to use these individual products.

Gerben
Maaike8
Posts: 3
Joined: Tuesday 17 April, 2018 - 11:20

Re: Reading labels with the assembler

Post by Maaike8 »

Ok, I created a container with products on it. I used the unpacker to get separate products again, but how can I let the assembler know that the separate products that were in the container before still belong together? So, if the assembler decides to get one of those products, he needs to take them all, because it was one donation and they still belong together.
Post Reply