Cancel
Showing results for 
Search instead for 
Did you mean: 

SimTalk: how to write a simple code?

Creator
Creator

To whom it may concern,

 

I am a student at FH Aachen, currently trying to finish my master thesis, so I was hoping for some help.

This is the setup:

I have a Source connected to 5 SingleProcs = Boilers, where all of them are connected to one buffer which is then connected to 6 SingleProcs = Dryers and after that to a Drain. The Source creates MUs from a table file.

The problem:

I would like to program an entry method for the all 5 Boilers so, that an MU can enter a Boiler only if only 2 Boilers are in operation (occupied), or 1 Boiler and 1 Dryer are in operation or 2 dryers are in operation.

 

So my question is:

  1. Is this even possible
  2. And how approximately would the code look like.

 

I know it is an easy code to write, but I did no programing before so it would be a great help for me.

 

Thank you in advance.

 

Regards,

 

 

JD

12 REPLIES

Re: Plant Simulation: SimTalk

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I guess the entrance control of the boilers would be the wrong place. You need to make this decision in the exit control of the source.

 

With your logic you will have some problems to start the simulation:

 

How do you want to handle the "start-cases": nothing is occupied ? Only one boiler is occupied?

 

After moving the second MU to the boiler we can start with your conditions...

 

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

Re: Plant Simulation: SimTalk

Creator
Creator

the start case is: nothing is occupied and only 2 MUs are going into the production (being produced by source), so they occupy only 2 boilers. So all I basically want to program is that the MUs can enter a boiler only if 2>= boilers are occupied, or 1>=boiler and 1>=dryer, or 2>= dryers are occupied.

 

how would this work with the exit control? what did you have in mind?

 

 

 

Re: Plant Simulation: SimTalk

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you can use a waituntil statement (see help) in the exitcontrol of the source. This helps you to wait, until one of your conditions is true, then the MU is released.

This may look like this:

 

is

do

 waituntil (boiler1.numMu+boiler2.numMu+boiler3.numMU+boiler4.numMU....+dryer1.numMu+...dryer6.numMU=0) or

(boiler1.numMu+boiler2.numMu+boiler3.numMU+boiler4.numMU....+dryer1.numMu+...dryer6.numMU=1)  or

(boiler1.numMu+boiler2.numMu+boiler3.numMU+boiler4.numMU+boiler5.numMu = 2 ) or

-- and so on

prio 1;

@.move; 

end;

 

 

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

Re: Plant Simulation: SimTalk

Creator
Creator

first of all, thanks a lot for the quick responses, but I do have a doubt. i am trying to make this method work because the boilers consume a lot of energy and if all 5 boilers work at the same time the energy peak is to high. we want to lower energy peaks by not allowing the boilers to start with "boiling" before only 2 boilers, or 1 boiler and 1 dryer, or 2 dryers or less are working. that is why I do not want the boiler to start the process until it is sure that the energy peak is low enough.  since the boilers work for 3 days and the source produces 2 or 3 MUs every second day, or sometimes 3 consecutive days, it will (with the exit control) mean that at one point all boilers would be working. or am I wrong? did I understand it correctly?

 

Re: Plant Simulation: SimTalk

Creator
Creator

I think that the best way would be to assign the method to MUs!?

is this possible?

and why is the waituntil comand not possible to assign to entry control?

 

thanks again Smiley Happy

Re: Plant Simulation: SimTalk

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

First, you decide with the exit control of the source, when the source releases a MU. If you set the control in the entrance of the boilers, then it is too late. (the processing starts, if you move a MU to e.g. a SingleProc).

 

Second: it is only a matter of boolean algebra. Your conditions are incomplete.

 

I think you need (at least) the following conditions (for moving one additional MU in direction of the boilers)

 

1. all boilers are empty and all dryers are empty and the buffer is empty

2. only one boiler is occupied and all dryers are empty and the buffer is empty

3. two boilers are occupied and all dryers are empty and the buffer is empty

4. one boiler is occupied and one dryer is occupied and the buffer is empty

5. all boilers are empty and less then two dryers are occupied and the buffer is empty (1. is a special case of this)

 

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

Re: Plant Simulation: SimTalk

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi JD89,

 

Alternatively, you could use an Exporter with a capacity of 2. Then you can enforce that only 2 processes are active simultaneously. And without any programming.

 

There are some examples with your installation that explain how it works.

 

Regards,

Gert Nomden


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Plant Simulation: SimTalk

Creator
Creator

I am sorry for the misunderstanding. I was talking about the entry method of the boiler and now I saw that you mean the source Smiley Happy. But I would also like to do the same for the dryers. so that an MU is going to enter a dryer only if ... the same conditions. that is why I would like to program the entry method for the SingleProc.

 

And one more time, thanks a lot for the answers. the problem is that in my faculty no one is using this program so there is no one to ask but you. I real appreciate it Smiley Happy!

 

 

Re: Plant Simulation: SimTalk

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi,

 

I have attached a small model that seems to do what you need. Essentially, you can consider the MUs as jobs or batches. The EnergyCapacity object is set to 2. The SingleProcs request this flexible capacity, but only 2 units are available for all SingleProcs. If you check the flow you will see that no more than 2 SingleProcs are active at the same time (green led).

 

Regards,

Gert Nomden


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com