Cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with move operator

Creator
Creator

Hello community,

 

I'm new to plant simulation and stuck to a simple problem I guess.

 

The Layout i'm trying to simulate has a loop structure for the first stations and after entering the 2nd time a specific station the MU needs to move to the next steps.

I gave the MU the user defined type : integer and the value : 1

And as exit method for my material flow i wrote the method:

 

is
i:integer;
do
       if  i=1;
       @.move(Station_1);

        i:=i+1;
else
        @.move(Station10);
end;

 

The Error i get says that "move is not allowed in formulas"

 

I hope my problem is clear and you can help me.

 

Greetings

Fabian

5 REPLIES

Re: Problem with move operator

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

there is a syntax error in your method:

 

is
i:integer;
do
       if  i=1 then
           @.move(Station_1);

           i:=i+1;
        else
            @.move(Station10);
        end;
end;

This method will only move to Station10. Startvalue of i is at each call zero, so the else branch is selected.

 

If you want to increment i with each call, you should use a global variable i instead a local variable.

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

Re: Problem with move operator

Creator
Creator

Thank you for your fast help.

Without changing the global variable it still tells me that move ist not allowed in a formula...

How can i change the variable to a global?

Also in the data type of the MU and create a method for the start value 1?

Re: Problem with move operator

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
can you post your model? I guess there is another failure in your method.

You find the global variable in the class library; folder information flow. Just insert the variable block into your frame, rename it to i, change the data type and delete in your method the line
i:integer;
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Problem with move operator

Creator
Creator

Hello Steffen,

 

Now it works perfect! Thank you so Much!

Und auch auf deutsch, vielen lieben Dank Ihnen!Smiley Happy

Re: Problem with move operator

Creator
Creator

Okay sorry,

 

i post my model...