flexible version of assembler atom

All topics on the Atoms in any Enterprise Dynamics Library.
schepers
Posts: 14
Joined: Thursday 19 January, 2012 - 12:08

flexible version of assembler atom

Post by schepers »

Hello,
my subject is to configure the assembler atom as far, that it accept for example one product from channel one and n (any amount) of products from channel two after a fixed time of not arriving any product to channel two. I need a flexible version of the assembler. Can please somebody help me?
Thx. Ralf
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: flexible version of assembler atom

Post by marlies »

Hi Ralf,

I made small example for you that you can find in the attachment. I made use of the User Events atom to get the following behaviour:
1. The assembler packs a maximum of 4 products in a container (this maximum is defined in the BOM).
2. When a product enters through the 2nd ic, the assembler creates an event called StartAssembly on the User Events atom.
3. In the user events atom I defined that this event will be executed 2 minutes afterwards (the max waitingtime for the next product is 2 minutes).
4. If a new atom arrives within these 2 minutes, the event will be destroyed and recreated (the waiting time is reset).
5. If no product arrives within the 2 minutes, the user events atom will trigger the assembler to start the assembly process.

Please check the code in the user events atom and in the entrytrigger of the assembler.

Hope that this example fits within the solution you were looking for.

Regards,

Marlies
Attachments
20120119_Assembler.mod
(27.77 KiB) Downloaded 551 times
schepers
Posts: 14
Joined: Thursday 19 January, 2012 - 12:08

Re: flexible version of assembler atom

Post by schepers »

Thx, thats it.
schepers
Posts: 14
Joined: Thursday 19 January, 2012 - 12:08

Re: flexible version of assembler atom

Post by schepers »

Ok, I'm trying to rebuild this into my model. But the it stops after 2 minutes. I don't know why. Do i have to change the reference inside the user event? CreateEvent(mins(2),vtp(258866180),1,9999999999) (vtp).
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: flexible version of assembler atom

Post by MarvinH »

Hello Ralf!

I'm sorry to read that your model stops after 2 minutes.

The reference within the user event should not have to be changed, this is done automatically. Did you connect your User Event and Assembler the same way (regarding the channels) as Marlies has done in her example? If so, then please post your model so someone can have a look at it.

Regards,

Marvin
Eggbert
Posts: 9
Joined: Wednesday 23 May, 2012 - 12:38

Re: flexible version of assembler atom

Post by Eggbert »

Actually I need this flexible version. But I need to understand this code: CreateEvent(mins(2),vtp(258866180),1,9999999999)
and
dditionally I want to start this Event when to Container is half full.

thank you
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: flexible version of assembler atom

Post by marlies »

Hi Eggbert,

I don't know where you found this code as it is not in the example model? The meaning of the code is;

Code: Select all

CreateEvent(
  mins(2), { = Create the event after 2 minutes }
  vtp(258866180), { = Create the event at atom with reference vtp(258866180), but using a reference number is not a working as it will be changed the next time you load te model. As a reference you should you use another atom reference like c or i }
  1, { = Create event number 1, which is referring to the number of your event in the OnEvent handler }
  9999999999 {  = the priority of the event, the higher the number, the higher the priority which means that it will be executed before any other event at the same time }
)
When you want to create an event when an atom is half full you need to check the content of that atom in an If statement with the 4Dscript command Content(atom reference like c or i)

This could be something like:

Code: Select all

If(
 Content(c) = 2,
 CreateEvent(mins(2), c, 1, 999)
)
Hope this helps, if not could you please post your model to help us tracking the problem.

Regards,

Marlies
Eggbert
Posts: 9
Joined: Wednesday 23 May, 2012 - 12:38

Re: flexible version of assembler atom

Post by Eggbert »

Hey Marlies,
thanks for your answer.
I already have an idea (when it have to start the event). I still dont know what I have to setup in the user event atom, to start the assembly after (for example) 5mins.
I only have to write the event name in the 4d script to start it, right?
thanks
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: flexible version of assembler atom

Post by marlies »

Hi Eggbert,

Yes, to let the assembler trigger the User Events atom to execute your event, you only have to use the name of the event in a trigger of the assembler. It's like using your own 4DScript command that refers to the code on the user events atom.
In the user events atom itself you can define how long the events atom should wait before executing the code. So the 5 minutes you mentioned should be in the field Event Time in the User Events atom.

Regards,

Marlies
Eggbert
Posts: 9
Joined: Wednesday 23 May, 2012 - 12:38

Re: flexible version of assembler atom

Post by Eggbert »

Sorry for asking again.... but it still doesnt work. In the example module are some codes.
The assembler code is ok.

This code is in the "Create Event" tab in the StartAssembly event.
CreateEvent(mins(2),vtp(258866180),1,9999999999)
This one is in the timetable of the userevent atom.
Do({storethereferencetotheassemblerinavariable}Var([atmAssembler],vbAtom,in(1,c)),{closethe2ndinputchannel,thiswillstoptheproductsfromenterin.}closeic(2,atmAssembler),{updatethestatusoftheassembler}setstatus(2,atmAssembler),{andcreatethefinishassemblyeventbasedonthecycletimeattribute}createevent(att([cycletime],atmAssembler),atmAssembler,2))
Also the name of the event has a prefix "att_", but in the assemblercode its called without it.

regards
Post Reply