Cancel
Showing results for 
Search instead for 
Did you mean: 

Create exact number of MUs based on orders

Dear community,

 

my question is about how to create the exact number of MUs to fulfill the order request; as you can see from the image below (the model are attached)Model.png

 

 

I've one table (Tab_dom) with the amount of article (articolo) and quantity (quantità) to be produced.

From the source starts a generic MUs called entity who can represent a raw material for my purpose.

As soon as it gets to M1 the MU entity will be erased and created a new one (highlighted in red) based on the request of the article in Tab_prod (highlighted in green).

Now i got two question i'm not able to solve:

- how can i create the exact amount of MUs based on order (in this example firstly 10 Mus of article A and then 3 of B) without using a table in source (i need to simulate the raw material)?

- how can i use an index in the method "M1 on entrance" to switch between articles as soon as one has finished?

Thanks for the help.

 

4 REPLIES

Re: Create exact number of MUs based on orders

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

if you create for each order one line (10 lines A and 5 lines B), then you can use an global  variable (e.g. prderpos, data type integer, start value=1) to read the next position and create the right part; you can use the name in column 1 to create a pointer to the class e.g.

 

if tab_dom[1,orderPos] /= void then
  .Mus.extendPath(tab_dom[1,orderPos]).create(?)
  orderPos:=orderPos+1
end
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Create exact number of MUs based on orders

Dear Steffen,

thank for the quick reply, i'll test asap.
But if i want to keep just one table without a line for every order how can i solve my problem?

Re: Create exact number of MUs based on orders

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

than you need to count the created parts, if the number of created parts is equal the planned number of parts, you can start the next row in your program: you still need a variable to remember the row number in the program, you need to format the third column in tab_dom as integer e.g.

 

if orderPos <= tab_dom.yDim then
  .Mus.extendPath(tab_dom[1,orderPos]).create(?)
   --count parts
  tab_dom[3,orderPos]:= tab_dom[3,orderPos]+1
  --next order, if all parts created
  if tab_dom[3,orderPos] =  tab_dom[2,orderPos] then
    orderPos:=orderPos+1
  end
end
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Create exact number of MUs based on orders

it worked like a charm.

Thank you Steffen