Cancel
Showing results for 
Search instead for 
Did you mean: 

Help on programming

Experimenter
Experimenter

Hi all.

 

I just started using Plant Simulation and I have the following scenario:

 

4 procs (P1, P2, P3, P4), each must have capacity of 2 (Do I need to use paralell proc for this? it is just one machine).

2 parts enters P1 and follow to P2. While P1 is occupied the parts must go to P3 then P4. (P1 and P3 does the same job, so does P2 and P4)

The parts that entered P1 should not enter P3, just follow directly to the drain.

I cannot change the machines positions.

The model attached is not working (of course) it is just to illustrate how it should look like. I know I will need one or more methods and I can use turn tables if needed, I just don't know how to program it to work the way I need.

I appreciate any help.

 

Thank you all in advance

6 REPLIES

Re: Help on programming

Phenom
Phenom

I have set a marker using the mu.label attribute

 

to distinguish between already processed ( station1/2) -> 1

 

and (maybe for future features)  for station3/4 ) -> 3

 

Have a look, if that suits you.

 

Unbenannt.PNG

 

 

 

 

Re: Help on programming

Experimenter
Experimenter

Thank you very much, it helped a lot

Re: Help on programming

Experimenter
Experimenter

Hello,

 

I have another issue on this model now. I'm using parallel proc because I need capacity = 2.

The problem is: 1 part enters s1 and the other follows to s3, I need 2 parts to enter at once. s3 is to be used only if s1 is not available.

I tried using another flow control to do so but still no good.

 

I appreciate any help and thank you all in advance

Re: Help on programming

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you could use the exit behavior method of the FlowControl (default entrance behavior):

 

-> integer

-- @ is the movable unit
if S1.operational   
 return 1
else
 return 2
end

 

The FlowControl will "decide" for each MU, so the movement of the parts will not be "two at the same time".

If you want to achive this behavior, you need to collect two in a buffer and move them from there with SimTalk.

In version 14.1 you have an option in the ParallelProc (station) to wait with the processing, until the station is full.

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

Re: Help on programming

Experimenter
Experimenter

I thoght it worked but I used the wrong word to explain. The parts go to S3 while S1 is occupied (I said available, sorry).

Then I tried to modify the code but I'm not good at it:

 

-> integer
var x := 1
var y := 2

if S1[x,y].occupied
    return 2   
else
    return 1 
    end

 

Then it works the way I want, but just once then the line stops. I suppose I need to put this in a loop I just don't' know how (I'm a beginner)

 

Thank you very very much in advance

Re: Help on programming

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
then the condition for moving to S1 is: S1 is operational and not full (if you load the first part to S1 it is already occupied), you need only to extend the condition:

-> integer

if S1.operational and S1.full=false
return 1
else
return 2
end
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net