Would recomend looking into the interface object (.MaterialFlow.Interface) which can be placed on a frame as either a in or out connection. Think of it as a way of sending the MU's up or down 1 level in your model.
This should be the easiest way as it will enable you to use a connector to connect to your frame without the need of any custom code or logic.
Ok, then at which point something like the picture below should do the trick.
What this is doing is looking at row 3 in the table and looking to see if there is another element to the right, if so then it incroments the i value and checks again. When it cant find a value then it will pick a number within that range to address a random column and then continue.
Hope this is what you want, but personally interfaces and connectors are a lot better as there is lots of different exit methods you can do while doing it this way you got to program each one yourself but I do guess for a non linear process flow then it can be useful.
as a newbie i really appreciate your help; unfortunately, as you noticed, i have a non linear process and i'm forced to use method to "push" MUs inside the model.
What i need to do is to achieve the exact "behavior" of moving MUs between the 2 buffer like the image below (normal interface connection)
But in a situation like frametest 2 The method i've written it's working just for one buffer but the other is not receveing any MUs.
Thanks in advance for any help.
the exit control will move only one part, so only one buffer is feeded in your method.
If you want to distribute the MUs you need a kind of switch, that remembers the value from the last method call (e.g. global variable cycle, inteher, start value=0).
is c:object; d:object; do --load sequentially to the buffers if cycle=0 then c:=.Models.Frame.Tab_Reparti[1,3]; @.move(c); cycle:=1; else d:=.Models.Frame.Tab_Reparti[1,4]; @.move(d); cycle:=0; end; end;
If I remember right then the default method is 'cycle' meaning it will do one, then the other, then the next until it reaches the first one again.
For this I would say you need to store a number outside of the method to add a bit of history to system, from this you can then do something like the following...
By using a variable of type integer (initial value of 1) you can track what was the column in the table that a part was last sent to. The if statment will check if the column you are pointing to is empty and if so will then reset you back at column 1.
Through doing this, if you needed another process line to be added you can just add it to the next column and if you needed another area to feed to the same location you can use the same integer variable to ensure that the cyclinic nature is still observed.
Hope this helps,