Assembler

All topics on the Atoms in any Enterprise Dynamics Library.
Freek
Posts: 12
Joined: Monday 29 October, 2018 - 11:22

Assembler

Post by Freek » Monday 29 October, 2018 - 11:46

Hello,
Im using Enterprise dynamics for my internship,but im a litle stuck at the moment.

In my model im using an assembler that puts 4 different kinds of products on pallets. I want the assembler to decide on the name of the product what columm reference it has to use like this:
if(CompareText(Name(in(Rank(2,c))),[P10]),1,
if(CompareText(Name(in(Rank(2,c))),[P20]),2,
if(CompareText(Name(in(Rank(2,c))),[P25]),3,
if(CompareText(Name(in(Rank(2,c))),[P30]),4))))

The problem is when a pallet (input channel 1) enters the assembler it also checks for its name and it gives me an error.
How can i make it so that the assembler only checks input channel 2 for the collum references?

Freek
Posts: 12
Joined: Monday 29 October, 2018 - 11:22

Re: Assembler

Post by Freek » Wednesday 31 October, 2018 - 14:33

Nevermind the last question, i found a way to work around it.
But that gives me another problem.

I want a queue to set labels on products based on the labelname of the first product that leaves another atom(a conveyerbelt).
So when [Product 1] leaves the conveyerbelt. The queue triggers and gives the leaving atom from the queue the label: [P1].

The code i wrote (but wich doesnt work)for the exit trigger of the queue:

If(content(in(2,c))>0,
if(Label([PAA],(first(in(2,c)))=10)
,Label([P1], c) := 1,
if(Label([PAA],(first(in(2,c)))=20)
,Label([P2], c) := 2,
if(Label([PAA],(first(in(2,c)))=25)
,Label([P3], c) := 3,
if(Label([PAA],(first(in(2,c)))=30)
,Label([P4], c) := 4)))
)
)

When running the model im getting the error message: No atom currently selected.

Anyone can help me with this? im new to coding and a bit stuck

User avatar
HarryBunnik
Posts: 310
Joined: Monday 07 February, 2011 - 11:22

Re: Assembler

Post by HarryBunnik » Thursday 01 November, 2018 - 16:12

Ha Freek,

I'm not sure I completely understand your question.

If you want to place a label on something in the queue at the moment a product leaves a conveyor, you have to write this code on the ExitTrigger of the conveyor.

You can do that by placing a new label on the Queue which indicates what the name is of the label that you want to place on the products in the queue or already assign that label directly to the first product in the queue. If you do it on the ExitTrigger of the queue, the product on the Conveyor is most likely already gone, ergo the error message the no atom is selected.

So I would write some code on the ExitTrigger of the conveyor (which is connected over its second outgoing channel with the central or information channel of the queue) like:

Do(
var([atmQueue], vbAtom, out(2, c)),
Repeat(
Content(atmQueue), {Loop over the content in the queue}
Case(
InList(Label([PAA], i), {Label on product leaving the conveyor} 10,20,25,30),
Label([P1], rank(count, atmQueue)) := 1,
Label([P2], rank(count, atmQueue)) := 2,
Label([P3], rank(count, atmQueue)) := 3,
Label([P4], rank(count, atmQueue)) := 4
)
)
)

This code loops, when a product "A1" leaves the conveyor (ExitTrigger) and over the content of the Queue and places on each product in the queue, a Label P1/P2/P3/P4 depending on the label PAA that is defined on the product "A1".

I hope this helps you a bit further.

Regards,

Harry

Freek
Posts: 12
Joined: Monday 29 October, 2018 - 11:22

Re: Assembler

Post by Freek » Friday 02 November, 2018 - 16:53

Hello Harry,
Thank you verry much, really helped me out.
I've got another "problem" now tho, maybe you can help me with that one aswell?

I want the assemblers that come after the robot (see model) to stop putting parts on a pallet if it isnt the right part.
Right now when for example product 2 is being assembled wich consist of: 1 [pallet], 24 [20literpackages] and the input is only 10 [20literpackages] it uses 14 products of the next product coming in. I want the assembler to just send the product away with the 10 [20literpackages] then.
So when the label of the incoming product in the 2nd inputchannel changes, it shut send the current pallet away (even tho it isnt complete).

I hope u understand the what im trying to say :?

Thanks in advance!
Attachments
Lijn 1+2+3 + pull.mod
(844.93 KiB) Downloaded 41 times

User avatar
Ignasi Echaniz
Posts: 16
Joined: Monday 28 May, 2018 - 10:44

Re: Assembler

Post by Ignasi Echaniz » Thursday 08 November, 2018 - 16:20

Hi Freek,

If I understood you correctly, what you want to do is perfectly possible.

To do so, you should include the following piece of code in the exit trigger of your robot

Do(
{Here your other code exit trigger of the robot}

var([VarExitchannel],vbvalue),
if(CompareText(Name(i),[H2O2]), VarExitchannel:= 1,VarExitchannel:=2),
if(
and(
content(rank(1,out(VarExitchannel,c)))>0,
label([paa],i) <> label([paa], rank(1,rank(1,out(VarExitchannel,c))))
),
do(
{Stop --> use "stop" if you want to check whether is working},
OpenAllOC(out(VarExitchannel,c)))
)
)

The above code checks whether the product in the robot is the same of the ones in the assigned assembler. If not, the pallet is pulled out automatically and a new pallet is used when the new product enters the assembler. You can you use the code STOP before opening the channels to stop the simulation and check that indeed the code is working.

Please find your model attached with the new code.

Let me know if this was what were you looking for,

Kind regards,

Ignasi Echaniz
Attachments
Lijn 1+2+3 + pull_SolvedAssembler.mod
(844.43 KiB) Downloaded 44 times

Freek
Posts: 12
Joined: Monday 29 October, 2018 - 11:22

Re: Assembler

Post by Freek » Monday 12 November, 2018 - 15:54

Thank you very much, that was indeed what i needed!

Freek
Posts: 12
Joined: Monday 29 October, 2018 - 11:22

Re: Assembler

Post by Freek » Wednesday 21 November, 2018 - 11:09

Hello forum,

Im still working on my model, and its working for the most part. But i have got 2 problems wich i dont know how to fix.
1. At "lijn 1" in the model i added a Humanresource, and i want the worker to transport the products on te conveyer, and he needs to go to one of the servers(feige afvulmachine) when it needs a setup. It gives me the error: "Error finishing task in humanresourceatom1"

2. I want to keep track off the utitliy rates of the machines using grahps(statusmonitors), but only when the factory is active. Connecting the time schedule to these grahps doesnt seem to work.

Anyone knows how to fix one or both of these problems?
Attachments
Model1.zip
(268.07 KiB) Downloaded 32 times

User avatar
HarryBunnik
Posts: 310
Joined: Monday 07 February, 2011 - 11:22

Re: Assembler

Post by HarryBunnik » Thursday 06 December, 2018 - 15:18

Hello Freek,

Sorry for the late response, but your post slipped through somehow and wasn't noticed earlier.

First a few general remarks.

If you want the code to consist out of more than one line, you have to place it within a Do( ... ). The "&" you used is a "bitwise and expression", which is looping through the lines compared which is why your code is working (a very creative solution) but is not intended to be used in this way.

To use a MoveAtom in a queue can interrupt the internal code of your Queue "Aansturing". If it is not necessary, I would not use that code. I think with the SendTo and some Open- and CloseOutputs you can get the desired behavior in a more safe way.

1.

That is an interesting one. It seems as if the Human Resource has trouble with working on a setup. I'm only not sure why. A workaround that was working for me was to split the server "Feige afvulmachine lijn 1" in 2 servers. One for the setup and one for the actual task.
I'll look into why it is not working, but then at least you can continue with the model.

2.

That is currently not possible with the standard atoms. What is possible is to connect the server with the time schedule. Then the time that the factory is not active is indicated as "Not Available".
Model2.zip
(248.89 KiB) Downloaded 33 times
I hope this helps you further and again, I'm sorry for the late response.

Regards,

Harry

Freek
Posts: 12
Joined: Monday 29 October, 2018 - 11:22

Re: Assembler

Post by Freek » Friday 07 December, 2018 - 15:09

Hello Harry,
Thanks for the feedback. You are helping my out quite a bit. Ill try to replace the moveatom and "&" codes (im a bit new with the program and coding so i just trial and error until things work ;) ).

Ill keep u updated here if i need your help with more problems :)

Freek
Posts: 12
Joined: Monday 29 October, 2018 - 11:22

Re: Assembler

Post by Freek » Thursday 13 December, 2018 - 12:58

hello Harry,

The changes you made to the setuptimes for the "feige afvulmachine" seem to work only once at te start when i run the model. Is it possible that the setup gets repeated everytime the value of the label "PAA" changes?
I dont really understand how the function: "getsetupcode" works and where the label [t-oldsetupcode] comes from, shut i be changing this label?

Post Reply