I'm a new user to Plant Simulation and I'm having a little problem in my simulation. I have two line in my model - Line1 and Line2. I have to simulate this situation: Line2 moves only when on Line1 is, for example, 3 MUs. I try to use metod but I dont know how to write it correctly.
This is the method I try to use for Line1 (controls, exit)
if Line1.NumMU=3 then
Second metod which I try to use
n : integer;
n := Line1.statNumIn;
if n = 3 then
Does anyone know how to simulate this situation? Thank you for any help.
Plant Simulation can observe values and trigger methods, if the value is changed. In your case you could observe numMu and switch on line 2, if the value of numMu is 3 and switch of, if not.
Select in Line1 Tools - Select Observers - New - Observed value --> select numMu in the field Executed Method Press the F4 key, then a method is inserted in your Line. Finish with ok. In the observer method you can check the value and react to the changes:
if line1.numMu=3 then
The observer calls this method at every change of the number of MUs on the line1.
freelance simulation specialist
at first we have to catch the event, when the speed of Line2 must be changed.
There are two events:
1. A MU leaves the Line1.
2. A MU enters the Line1.
You create an observer for the attribute NumMU of Line1:
Goto the menu of Line1 Tools > Select Observers.
Please check the following code:
(attribute: string; oldValue: any)
if Line1.NumMU = 3 then
Line2.speed := 1;
Line2.speed := 0;