Page 2 of 2

Re: Assembler

Posted: Thursday 13 December, 2018 - 13:49
by HarryBunnik
Hello Freek,

I didn't look too deep into what was defined on the Setup time since that was for me a given. What is the behavior that you want to have? When is the setup time needed? Every time a new type of product arrives?

In that case, you can create a label on the "Feige afvulmachine" (be sure to clear it on reset using an Initialize atom) in which you store the PAA of each product that leaves the server.

Code: Select all

Label([LastPAA], c) := Label([PAA], i)
Then on the Setup time, you compare if this label is the same as the freshly entering product. If that is the case, no cycle time is needed. Otherwise, the cycle time of 300 must be used.

Code: Select all

if(
  Label([LastPAA], c) <> Label([PAA], first(c)), 
  300
)
Directly related is that on the OnEntry trigger a call for a Human Resource must be made.

I hope this helps you further.

Regards,

Harry

Re: Assembler

Posted: Thursday 13 December, 2018 - 16:11
by Freek
hi, thanks for the quick reply.

I indeed want the setup to be done when the value on a label changes. For example: when the server is processing atoms with label PAA with value 10 and a new atom comes in with with label PAA value 25 it shut do the setup.
However i still dont fully understand how to code it :? .

If i create the label on the "feige afvulmachine" like u said, shut i do this on the onentry or on the onexit? And the codes thats still there wich u made shut i delete/replace/keep those?
Im a bit lost here sorry.

Re: Assembler

Posted: Thursday 13 December, 2018 - 16:28
by HarryBunnik
Hello Freek,

I've made some adjustments to the earlier model to show you where I have in mind to place the code.

So I've changed the code on the "Feige afvulmachine lijn 1" (now responsible for the setup time. I think you have named them differently by now).

- CycleTime (only when the label is changing, the cycle time of 300 is used).
- Trigger on entry (only when the label is changing, the operator is called).
- Trigger on exit (always replace the label with the label of the last product leaving for the next compare).

And on the Initialize atom I've made a connection with the Feige Afvulmachine and made sure that at the beginning of each simulation, the label is set back to 0 again. Otherwise, you can have that the value of the last run is still stored and you can't be sure if an operator is called or not.
Model3.zip
(248.97 KiB) Downloaded 554 times
I hope this helps you further,

Regards,

Harry

Re: Assembler

Posted: Thursday 13 December, 2018 - 16:46
by Freek
Hello,

Thank you verry much, this seems to be working.
I indeed made some changes to the model, but im capable enough to copypaste your code :P

Thanks

Re: Assembler

Posted: Thursday 13 December, 2018 - 16:52
by HarryBunnik
Good :-)

And I have no doubt you can re-apply the code. I was only a bit "annoyed" that I hadn't taken the time earlier to adjust the naming of the machinery and now was stuck with names that are absolutely no longer describing what should be going on there ;-)

Good luck!

Re: Assembler

Posted: Friday 14 December, 2018 - 11:00
by Freek
This may be a stupid question. But what if i wanted the setup to happen when the value of the label changes?

So the labelname PAA stays the same, but has multiple possible values.
Whenever the value changes the setup has to be done 1 time.

Re: Assembler

Posted: Friday 14 December, 2018 - 11:19
by HarryBunnik
That is what is currently happening. When a product leaves the Server "Feige afvulmachine Lijn 1" I store the value of the label "PAA" that is defined on the product, in the label "LastPAA" that is defined on the server itself.

Every time a new product arrives in the Server, I compare its label "PAA" with the label "LastPAA" to see if the value changed. When it has changed, I apply the setup time, otherwise, I let it pass through directly.

And on the way out of the server, I always update the label "LastPAA", whether it has changed or not. That way I'm sure that I'm always comparing if the server really has changed products.

Re: Assembler

Posted: Friday 14 December, 2018 - 12:51
by Freek
The first time i changed the code it worked, but after resetting the model once it didnt anymore. So i geuss there is a problem with the resetting code, but i cannot find out what excactly.
Could u maybe take another look at it :o ?

Re: Assembler

Posted: Friday 14 December, 2018 - 12:59
by Freek
Nevermind i just found it, i connected the initialize atom to the wrong atom...

:lol: