Cancel
Showing results for 
Search instead for 
Did you mean: 

Part coming back to machine

Pioneer
Pioneer

Hi community,

 

I’m a student studying Plant Simulation. I have this problem formulating my model CurrentState (frame CurrentState):

 

How can I program so that the pallet will only be created 4 times in P1 (in the morning shift or equivalent 7h30’)? As you can see in my method CreatePallet, I created a pallet with 500 parts in it but I can’t control the number of times it is created. I tried “repeat … until” like this but what it shows is not what I wanted:

 

is

                i : integer;

                k : integer;

do

                k := 1;

                repeat

                .MUs.pallet.create(p1);

                for i := 1 to 500 loop

                                .mus.part.create(p1.cont);

                next;

                k := k +1;

                until k > 5;

                .Mus.pallet.create(p2);

                .Mus.pallet.create(p4);

                .Mus.pallet.create(p6);

end;

 

Another thing is, in frame CurrentState1, how I can simulate so that the products coming out of Machine2  will include the main products (which I named “Part” - to P4 and will continue the whole process) and the by-products (which I named “Half_part”) gathering in “Waiting”. These by-products will then come back to Machine 1 (when machine1 is not occupied) for the second round to undergo the same process but this time after Machine2 they will continue the subsequent steps and no new by-products are created and the process is completed.

 

So, with 4 times the parts passing Machine2, there should be 4 containers of by-products in Waiting. Then they all will go back to Machine1 the second time.

 

Because I can’t tell P1 to create the pallet only 4 times, I don’t know how to make by-products to come back to Machine1 when it’s busy all the time.

 

Please help!

Thank you and best regards;

Alan.

10 REPLIES

Re: Part coming back to machine

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi Alan,

 

Why so difficult? Use a Source object instead!

 

Change "Interval adjustable" to "Number adjustable" and you will get the desired amount of MUs, e.g. 4.

 

Or, if you want create different items with the same Source, you can set MU Selection to Sequence. You then use a table to fill in the different items that you want to create. An Assembly object would be suitable to put MUs on top of other MUs.

 

The Start parameter can be set to 7:30:00 (h:mm:ss). Or you can also use a ShiftCalendar object if the procedure is to repeated on a daily basis.

 

At least 95% of what you describe can already be done with the standard objects, without any coding.


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Part coming back to machine

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

for creating the pallets, you can use a nested loop. Insert all locations into a array, then you can create all pallets into a loop:

 

is
	i,k : integer;
	buffer:object;
do
	local buffers:object[]:=makeArray(p1,p2,p4,p6,waiting);
	for k:=1 to buffers.dim loop
		buffer:=buffers[k];
		.MUs.pallet.create(buffer);
		for i := 1 to 500 loop
			.mus.part.create(buffer.cont);
		next;
	
	next;
end;

to create by-products you can use the exit control rear of the machines

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Part coming back to machine

Pioneer
Pioneer
Dear Mr Steffen,

I very much appreciate your help. However, the code you gave creates pallets all filled with 500 parts at those buffer locations already. In my plan, the pallets at p2,p4,p6 and waiting are created empty at first. They will wait and receive the parts processed from p1-Machine1-p2 and then p3-Machine2-p4 and then p5-Machine3-p6.

And I would like p1 to create only 4 pallets (each filled with 500 parts) and then stop but I don't know what command is possible to dictate it and the by-product to come back to machine1 also.

I tried the delivery table but in my case the delivery time is not fixed at all so it's not realistic to state exactly at what time what part will be delivered by the source. Please shed some light. Thank you so much.

Re: Part coming back to machine

Pioneer
Pioneer
Hi Nomden,

I tried the delivery table but in my case the delivery time is not fixed at all so it's not realistic to state exactly at what time what part will be delivered by the source. Besides, it's not about the amount of MUs to be delivered, it's about a whole batch being delivered piece by piece and then the next batch and so on ... The thing is, is there any way for the by-products to come back at the first machine? I don't think we can do it without some code here.

Please shed some light. Thank you so much.

Re: Part coming back to machine

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

than you need one more loop in the init-method:

is
	i,k,m : integer;
	buffer:object;
	pallet:object;
do
	
	local buffers:object[]:=makeArray(p1,p2,p4,p6,waiting);
	for k:=1 to buffers.dim loop
		buffer:=buffers[k];
		if buffer /= p1 then
			--empty pallet
			pallet:=.MUs.pallet.create(buffer);
		else
		--4 pallets
			for m:=1 to 4 loop
				pallet:=.MUs.pallet.create(buffer);
				for i := 1 to 500 loop
					.mus.part.create(pallet);
				next;
			next;
		end;
	
	next;
end;

the create method returns a reference on the created object; using this reference you can access e.g. the created pallet to fill it.

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Part coming back to machine

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I did not mention the "Delivery table", it is unclear how you got there. When using "Interval adjustable" and MU Selection set to "Sequence", you can create batches of parts in the desired amounts. Under MU fill in the right class, under Number the desired amount of MUs and give a proper name (P1 etc.). There is a good decription of the Source object in the Help-pages!

 

Of course, if SimTalk feels comfortable, you can also go with Steffen Bangsow's suggestions.

 

Regarding the routing of MUs, you do need at least a little SimTalk. If the material flow does not get more complicated than you described, you can create a user-defined attribute for the MUs (e.g. FirstPassComplete: boolean). Then at the appropriate point you change this attribute. Subsequently you use a generic Exit control that check all passing MUs for this attribute and routes them. For those MUs that do one pass, you set it to true at the outset. This can also be done in the Source in the column Attributes.

 


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Part coming back to machine

Pioneer
Pioneer

Hi Mr Bangsow,

 

Thank you a lot for your code. It works perfectly on P1 and creates exactly 4 pallets full of parts as I need. Still I can't manage to create a pallet full of half_parts at Waiting whenever Machine2 has done with processing all the parts of the previous pallet. Given that Machine2 has to process 4 pallets passed on from Machine1, there supposed to be 4 pallets full of half_parts created in Waiting. The code I'm using can only do it once and I tried to resemble the loop you gave in your code but it fails somewhere along the way ...

 

I guess if I can't do it, I will need to find another way to interpret my result.

Re: Part coming back to machine

Pioneer
Pioneer
Hi Mr Nomden,

I tried the source as you said. It kind of works ok for the first step (and the later steps are still a problem for me) but in my case, from the very beginning the parts to be processed come in 4 different pallets so I would like to resemble it as close as possible.

And can you kindly clarify this: " you can create a user-defined attribute for the MUs (e.g. FirstPassComplete: boolean). Then at the appropriate point you change this attribute. Subsequently you use a generic Exit control that check all passing MUs for this attribute and routes them. For those MUs that do one pass, you set it to true at the outset."

Sorry if I'm being stupid coz I'm still a dreamer in this Smiley Sad

Re: Part coming back to machine

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you need only to find the right trigger, in your case it is, when you move the empty pallet from p3 to p4.

It is in the load2 method (exit control of machine2). Here you can create the pallet with half parts on waiting:

 

is
	i : integer;
do
	if ? = p3 then
		@.cont.move(machine2);
	elseif ? = machine2 then
		@.move(p4.cont);
		if p4.cont.full then
			p4.cont.move(gathering1);
			p3.cont.move(p4);
			--create a bin with halfparts
			local bin:object:=.MUs.pallet.create(waiting);
			for i := 1 to 500 loop
				.mus.part.create(bin);
			next;
		else
			p3.cont.cont.move(machine2);
		end;
	end;
end;
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net