Call Operator

All topics on the Atoms in any Enterprise Dynamics Library.
Post Reply
PvL
Posts: 4
Joined: Tuesday 11 September, 2012 - 16:04

Call Operator

Post by PvL »

Hi there,

Currently I'm working on a model to simulate a sorting machine. Each output conveyor has an assembler to stack products on a pallet. This operation must be supported by an operator. However, after the operator is called, the assembler already starts operating even when the operator is still on his way walking to the assembler. :o

On Init all conveyor output's are closed. The sorting conveyor has a closed output. When a certain content is reached, the output openes. Then the assembler calls the operator in the Trigger on entry chn. 2-n. The operator is member of a team, the team is connected to input channel 3 of the assembler. The code on Trigger on entry chn. 2-n is:

Code: Select all

If(
 Content(in(2,c)) >= valConvCutoff-1,
 CallOperators(in(3,c),1,1)
)
Why does the assembler already start working when an operator and how should I model this? Tnx in advance! ;)
Attachments
Kratsortering v4.mod
Sorting conveyor system
(213.96 KiB) Downloaded 454 times
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: Call Operator

Post by MarvinH »

Hello!

When the CallOperator statement is executed, as stated in the Help file, all events of the containing atom are delayed until the operator arrives. With the assembler, the EntryTrigger is executed immediately when an atom enters, afterwards events are scheduled. Therefore when a product enters, there are no events scheduled yet and thus no events are delayed.

In your model (attached to the topic), I have added a MultiServer with Capacity = 1 and CycleTime = 0. The difference between the MultiServer and the Assembler is that with the MultiServer, the events are scheduled before the EntryTrigger is executed. This way the events can be delayed and the product only exits the MultiServer 0 seconds after the operator arrives, which is I think what you wanted to achieve in the model.
Kratsortering v4_Update.mod
Updated calls and release of operators
(217.65 KiB) Downloaded 460 times
I have changed some triggers on the first (left most) sorting conveyor, assembler and MultiServer. Please have a look at the behaviour and check whether I did not change your desired functionality/controls. If you agree with my implementation, you can apply the changes to the other sorting lanes as well.

In case of any questions, do not hesitate to return to this topic.

Good luck!

Kind regards,

Marvin
PvL
Posts: 4
Joined: Tuesday 11 September, 2012 - 16:04

Re: Call Operator

Post by PvL »

MarvinH wrote: I have changed some triggers on the first (left most) sorting conveyor, assembler and MultiServer. Please have a look at the behaviour and check whether I did not change your desired functionality/controls.
Sorry for my late reply, I've been enjoying a well-deserved holliday :mrgreen:

When running your version of the model the operator is neatly released after the first batch of crates. However, during the next batches he is being called ok but not released anymore. You can see this if you run the model for a longer time >> both operators are stuck at the first conveyor and the input conveyor floods.

I gave it a new try myself but it seems like my interpretation of the 'current atom' (c) and 'involved atom' (i) is not correct. For example, in my new version I applied your tips to apply a label ([CallOps]) for the first crate that enters the empty conveyor and to use a server to call and release the operator. The operator is being called correctly, but not released. My question now is, when an operator is called, to which atom does it then belong? Is it to the server? Or is it to the crate that is being processed in the server..? I think the answer on this will clear up a lot. :ugeek:
PvL
Posts: 4
Joined: Tuesday 11 September, 2012 - 16:04

Re: Call Operator

Post by PvL »

Oops, forgot to attach the model :oops:

I guess the problem is that the operator is connected to the first crate on the pallet. For the first batch the reference of First(...) is working, but for all other batches the operator is not connected to the first atom on the pallet, but to the first atom of the next batch. There the FreeOperator function goes wrong when referencing to the first atom.... But, how to solve this...?
Attachments
Kratsortering v5.mod
CrateSorting - problem with FreeOperator
(227.23 KiB) Downloaded 396 times
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: Call Operator

Post by MarvinH »

Hello!

The issue with releasing the operator indeed has to do with the reference to which atom it is called.

You can solve it by using labels again. When you call the operator (more in particular, when you call it at the server), it is assigned to the first atom (i.e. crate/product) inside the server. This products moves onto the container at the assembler and the operator should be released when it has finished the container.

The first time this is oke, as with the FreeOperator command there is a reference to the atom that was used to call the operator, which is the first atom on the container. However the second time, another atom was used to call the operator and thus releasing the operator fails.

This fix this, you can assign a label with the atom that was used to call the operator. So, OnEntry of the server you can do the following:

Code: Select all

If(
 And(
   Content(in(1,c)) >= valConvCutoff-1,
   Label([CallOperator], c) = True
 ),
 do(
  Trace([assembler1: call operator]),
  Label([CallOperator], c) := False,
  { * Store the reference to the atom that triggered the call of the operator * }
  Label([CallReference], c) := i,
  CallOperators(in(2,c),1,1)
 )
)
OnExit of the conveyor, you can use this label to release the operator by the following code:

Code: Select all

if(
 Content(c) = 0,
 do(
   CloseOutput(c),
   Trace([conveyor1: free operator]),
   FreeOperators(in(2,out(1,c)),vtp(Label([CallReference], Out(1, c))))
 )
)
As you can see, we use the label assigned before as the second parameter in the FreeOperators function, by converting the value of the label to a pointer by "vtp".

Please try this code and return to this topic in case of any questions.

Kind regards,

Marvin
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: Call Operator

Post by MarvinH »

Sorry, missed your uploaded model. Here's the code for your Entry and Exit triggers in the last model:

OnEntry:

Code: Select all

if(
 Label([CallOps],i) = True,
 Do(
  Label([CallReference], c) := i,
  CallOperators(in(2,c),1,1),
  Label([CallOps],i) := False
  )
 )
OnExit:

Code: Select all

if(
 content(in(1,c)) = 0,
 FreeOperators(in(2,c),vtp(Label([CallReference], c)))
 )
Good luck!

Marvin
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: Call Operator

Post by MarvinH »

Hello,

I took the liberty to further adjust your model, as I was missing the closing of the conveyors after it was emptied. The following changes are applied:

- Implemented calling and releasing of operators at the server;
- Storing on a label whether a operator was already called or not, to avoid multiple calling of operators;
- Closing and opening of the conveyors;
- Resetting labels of the servers at the Initialize atom by connecting the central channels.

Please review the changes on the Initialize and Entry/ExitTriggers of the servers and conveyors, I think this is close to the desired functionality.

Kind regards,

Marvin
Attachments
Kratsortering v5_Update.mod
Updated v5 model
(231.27 KiB) Downloaded 400 times
PvL
Posts: 4
Joined: Tuesday 11 September, 2012 - 16:04

Re: Call Operator

Post by PvL »

Hi Marvin,

Thanks a lot for your support! The model is now running as it should be (after changing some settings and the empirical ditribution, but that's finetuning). I even understand the changes you applied, although the vtp function is getting a little too technical for me ;)

Now I can start optimizing the system, as the model is clearly showing the bottlenecks now.

Thanks again for the great support!
refbakker
Posts: 4
Joined: Monday 10 March, 2014 - 14:26

Re: Call Operator

Post by refbakker »

Hi there,

I am trying to do something similar as done this model, however when I run this updated v5 model I get some of errors. These are the same errors I am getting in my model. OnEvent>No atom currently selected: cs. Could you explain how to solve this error.

Thank you in advance.

Best regards,
Rutger
Post Reply