Assembler and advanced transporter

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Pirkule
Posts: 9
Joined: Sunday 16 February, 2014 - 10:58

Assembler and advanced transporter

Post by Pirkule »

Hi,

I’m newbie in this 4D script coding and having a problem to get result I’m looking for.

Is there a way to create an event, where arrival of advanced transporter to queue after assembler, triggers assembler (with 2 input channels) do the assembling regardless of maximum product needed in input channel two?

Like there is one container going to assembler’s input channel one and maximum products going to channel two/container is 20. I want the assembling to start even if there are only 10 products in assembler when the transporter arrives to queue.

Thanks in advance and regards,
Mikko
Pirkule
Posts: 9
Joined: Sunday 16 February, 2014 - 10:58

Re: Assembler and advanced transporter

Post by Pirkule »

I think i found how i can get around the problem of assembler not packing it's content if the amount of product isn't same as predefined in assemblers B.O.M tabble by making the assembler to set it's B.O.M table dynamic and by using closeoutput/openoutput commands in queues before assembler.

Now i still need to know how i can make the ad.transporter to trigger the B.O.M table's update. The triggering event must be ad.transporter's arrival to queue after assembler. Ad.transporter isn't transporting any products when it arrives the queue.

I tried to use ic(c)=2 in my queue's "entry on trigger" as my ad.transporter (destinator) is connected to queue's input channel two.
It doesn't work as i think that ad.transporter doesn't really enter queue atom, or because i don't know how to use it properly.

Any ideas how to make this happen?

Regards,
Mikko
Attachments
DynamicAssembler.mod
(45.93 KiB) Downloaded 293 times
Nick
Posts: 48
Joined: Saturday 15 February, 2014 - 01:52

Re: Assembler and advanced transporter

Post by Nick »

Hi Mikko,

You are right about the Advanced Transporter not entering the Queue atom itself. The Advanced Transporter communicates via its input channel with the output channel of the Queue atom. In your case the Queue atom should let the Advanced Transporter know that it contains products. (That there are products to be transported.)

To do so, you could do a move request on the OCReady of the Queue atom in the atom editor. The MoveRequest function is used to request the movement of an atom through a specified output channel. If the output channel is open the atom is moved immediately. If the output channel is closed the atom is moved as soon as the output channel is opened.

On the OCReady of the Queue atom:

Code: Select all

If(
  Content(c) > 0,
  MoveRequest(First(c), SendTo),
  Do(
   CloseAllOC(c), 
   OpenOutput(in(2,c))
  )
)
Please take a look at the attached example model.

Regards, Nick
Attachments
Example_DynamicAssembler.mod
Example Dynamic Assembler
(21.1 KiB) Downloaded 323 times
Pirkule
Posts: 9
Joined: Sunday 16 February, 2014 - 10:58

Re: Assembler and advanced transporter

Post by Pirkule »

Hi Nick,

Thanks for your advice. I got my model working with one assembler by move request on the OCready of the Queue.
Now the problem is that the scenario i'm trying to simulate has multiple assembler groups where the same ad.tranporster needs to pick-up assembled containers.
Ad.tranporter needs first to pick-up the container from queue after Assembler 1 and then from queues after Assembler 2 and 3. Containers are then transported to Unpack atom. Lastly ad.transporter needs to return empty containers from unpacker back to assemblers.

Is there a way to get this working with Discpatcher atom as the ad.transporter's input channels cannot be connected to multiple queues?
When I connect the queue after assembler to dispatcher and not to the transporter, i get error message "Atom: Dispatcher30 (ID=245), OnIcReady>No atom currently selected: First()"
Is the ad.transporter even capable of transporting multiple products ( in this case multible containers ) from different locations simultaneously?

Thank you in advance.
Regards,
Mikko
Attachments
MultipleAssemblers.mod
(149.45 KiB) Downloaded 303 times
Nick
Posts: 48
Joined: Saturday 15 February, 2014 - 01:52

Re: Assembler and advanced transporter

Post by Nick »

Hi Mikko,

The Dispatcher atom can be used to collect products from different queues.
In the example model the load quantity of the advanced transporter is set to 2.

Regards, Nick
Attachments
example_advanced_transporter_3_14-1.mod
(54.49 KiB) Downloaded 322 times
Pirkule
Posts: 9
Joined: Sunday 16 February, 2014 - 10:58

Re: Assembler and advanced transporter

Post by Pirkule »

Hi Nick,

Sorry i think my last question was poorly formed.

The scenario i'm trying to simulate has 3 assemblers , each of them has to work like the assembler where the ad.transporter's arrival to queue after assembler triggered the assembling.

Now when i use the model you posted before (Example_DynamicAssembler.mod) with single assembler and ad.transporter, there is no problem,
but with multiple assemblers, when i need to connect multiple queues to same ad.tranporter via dispatcher the model ceases to work.
The error message that appears is ""Atom: Dispatcher , OnIcReady>No atom currently selected: First()" . Now i think this has something to do with the command "OpenAllOC" which opens the outputchannels of queue after assembler because removing that command also removes the error... but wasn't that also the function of "calling tranporter to queue"? So how can I use OpenAllOC to call transporter to queue with dispatcher if there isn't any products currently to pick up?

And by "Is the ad.transporter even capable of transporting multiple products ( in this case multible containers ) from different locations simultaneously?"
i meant that is it possible to make transporter to pick up containers from queues in this way:

At the start of model there are no containers in queues 1 and 2, Ad.transporters load quantity is set to 2.

Transporter goes to queue1 --> this triggers the assembler1 to do the assembling --> assembled container goes to queue1 --> one container is loaded from queue1 to ad.transporter --> then transporter goes to queue2 --> this triggers the assembler2 to do the assembling --> Assembled container goes to queue2 --> one container is loaded from queue2 to ad.transporter --> Ad.transporter deliveres both containers to sink. ??


If i correctly understand , as normal when transporter load quantity is set to 2. the transporter picks up 2 "products" from where they are available soonest , either 2 from same queue or from two different queues one from each. If there is only one product in queue 1 and none in queue 2, the transporter waits till another is available.

Now what i need is that tranporters load quantity is set to 2 and if there is only one product currently in queue1 --> transporter picks up only one container from queue1 and instead of waiting the next one to be available in queue1 or 2, it immediately goes to queue2 to pick up the next product when it is ready in it.

I think this question/comment is even more messed up than my previous but i hope you can get somekind of idea what i'm trying to accomplish.

Regards,
Mikko
Attachments
2_DynamicAssemblers.mod
(57.31 KiB) Downloaded 318 times
Post Reply