Cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Container at sensor

Valued Contributor
Valued Contributor

Hey everyone,

 

I'm a total beginner in programming Plant Simulation. I wanted to start with something easy.

I have a Line with 3 Sensors and every Container should stop at every sensor until the next Container arrives (Its like a Push System)

 

I tried my best for programming this easy thing but i failed.... So could someone please help me?

 

This is the programm I wrote:

 

is
do
if
 @.sensor:=*.MUs.Container;
 do
 wait;
if
 @.sensor:=next *.MUs.Container;
 then
 go on;
end
end
end

 

Please be glad with me this is my first programm.

I'm also thankful for tipps for my further learning.

 

Best regards,

IceTea

3 REPLIES

Re: Stop Container at sensor

Phenom
Phenom

I don't think your way of programming is very effective.

 

I mean, what you published here as a plant simulation method

 

has absolutely nothing todo with simtalk - not to say is fully made up.

 

I therefore strongly advise you at least to have a look at the

 

simtalk reference /help plus tutorials before diving into any modelling.

 

@line sensors

 

you can set the line sensors/methods here (s.b.)

 

Nevertheless keep in mind, that you can only stop the complete line ( e.g. line.stopped :=true)

which then will also stop any following Mus to move.

 

So either you split the line into multiple lines ( to be able to stop the line segments) or use a track ( here you can stop the indivdual MUs)

 

 

 

 

Re: Stop Container at sensor

Experimenter
Experimenter

Hi,

 

simulator already said it, your method has nothing to do with simtalk. You should start with the basics of PlantSim and SimTalk.

 

Nevertheless I prepared a quick and dirty model for you, so that you can see how it can work. Even if it is not the best idea to adress the sensors with absolute values.

 

I used two methods in the model.

1.) (when the enter the track)

 

If the MU collides, it starts the MU in front of itself.

 

if ?.numMU > 1 
	waituntil @.collided = true
	@.FrontMU.stopped := false	
end;

 

-----

2.) (used two times at the sensors - front and rear)

 

It stops the MUs as the arrive. And if the leave the get to start the MU infront of them if there is a collision again.

 

param index : integer

if  @.FrontPos = 2 and index = 1 or
@.FrontPos = 6 and index = 2 or @.FrontPos = 10 and index = 3 @.stopped := true end; if @.stopped = false if @.FrontMU /= VOID waituntil @.collided = true @.FrontMU.stopped := false end; end;

Regard,

 

Re: Stop Container at sensor

Valued Contributor
Valued Contributor

Hey,

 

Okay I see its not that easy I thought...

But anyway, thank you for your help the model you wrote is nearly that what I need so I will go on learning and try to modify it.

 

Best regards,

IceTea