Cancel
Showing results for 
Search instead for 
Did you mean: 

Method to Unload specific part in a buffer

Creator
Creator

Hello everyone!!!

 

I have been trying to create a model with methods. However I am new in SimTalk, so I would appreciate any help.

 

I have Part 1 and Part 2, I want that all the Parts 1 go to Buffer 1, and Parts 2 go to buffer 2.

 

For buffer 1 I did this code, but it is unloading both parts: part 1 and part 2

 

while @.occupied loop
@.cont.move(Buffer1);
wait(0.001);
if buffer1.full then
exitloop;
debug;--buffer is full, avoid endless loop

 

 

Thank you in advance!!!
end;
end;

3 REPLIES 3

Re: Method to Unload specific part in a buffer

Siemens Phenom Siemens Phenom
Siemens Phenom

You can use a simple if-statement:

if @.name = "Part1"
@.cont.move(Buffer1)
else
@.cont.move(Buffer2)
end

So parts name "part1" goes to buffer 1, all other parts goes to buffer2. 

Highlighted

Re: Method to Unload specific part in a buffer

Phenom
Phenom

@Armudi 

 

I have modified the unload/1 - methods a bit.

 

Have a look if the model behaviour suits you  now.

Re: Method to Unload specific part in a buffer

Creator
Creator

The unload is working, but I kept my Unload1 version.

 

 

Thank you!!!!! Now I can keep working on it Smiley Happy