my problem is, that I define material flow, setup time and processing time based on each entity's user-defined attribute. Here, I use the attribute PositionInWorkPlan to move the entity from one object to the next. Processing time and setup time of each station as well as the production sequence are defined based on the attribute EntityType. Both attributes are assigned at the source's MU selection/in the table MySequenceTable.
Besides the entities which enter the line at the source I use the Init Method and BufferBegin table to fill buffers before the begin of production. If I do so, these entities are lacking the necesarry user-defined attributes to be further processed. Hence, I would greatly appreciate any help on how to initally define the EntityType and set the PositionInWorkPlan to the correct value.
Thank your very much!
Solved! Go to Solution.
try adjusting your INIT-method like this:
is i:integer; k:integer; o:object; do for i:=1 to BufferBegin.yDim loop for k:=1 to BufferBegin[2,i] loop o := .MUs.Entity.create(BufferBegin[3,i]); o.createAttribute("EntityType", "string"); o.createAttribute("PositionInWorkPlan", "integer"); o.EntityType := "A"; -- or something else o.PositionInWorkPlan := 0; -- or something else next; next; end;
I hope this helps, happy Easter,
first of all thank you very much for your support and happy easter to you too.
I chose the first solution you proposed and it is working almost perfectly, but is it possible to define the attribute PositionInWorkPlan in the Init method in such a way, that the entity searches for its position in the sub table of my workplan based on which buffer it has been asigned to?
note that your buffer-capacities are too small for the settings in BufferBegin (capacity 8, create 10 parts). I've added a debug into the method for this case. Here's the new code:
is i:integer; k:integer; o:object; do for i:=1 to BufferBegin.yDim loop for k:=1 to BufferBegin[2,i] loop -- create MU on target buffer o := .MUs.Entity.create(BufferBegin[3,i]); -- check result of MU-creation if (o = void) then debug; --> MU could not be created; buffer full? else -- MU was created, proceed: -- create user-attributes for MU o.createAttribute("EntityType", "string"); o.createAttribute("PositionInWorkPlan", "integer"); -- set entity type (here example: alternate between A and B) if (k \\ 2 = 0) then o.EntityType := "ProductA"; else o.EntityType := "ProductB"; end; -- get row-number in workplan for this entity-type and initial buffer-object o.PositionInWorkPlan := root.MyWorkPlan["Operations", o.EntityType].getRowNo(BufferBegin[3,i]); end; next; next; end;