Cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing the MU within a transporter (AGV modelling)

Experimenter
Experimenter

Hi there,

 

So, I am modelling an AGV system and I would like to be able to choose where the AGV goes depending on the entity that it is currently carrying, i.e. the transporter carrying the red entity goes to SP1 and the transport with the blue entity goes to SP2.

 

Screenshot 2016-05-31 13.57.04.png

I would like to be able to access either the name of the entity or a user-defined attribute of the entity.

 

I hope I made myself clear Smiley Happy

 

Thank you.

6 REPLIES

Re: Accessing the MU within a transporter (AGV modelling)

Legend
Legend

Hello,
You can create a new attribute in your AGV, call it for example "CarriedColor" and when you create an MU on your AGV change this attribute according to the color.
When the carried MU is red :
AGV.CarriedColor := "red" ;

 

In the FlowControl, choose "MU Attribute" and open list : 

Attribute                     || Value ||     Successor 

CarriedColor                   red               1

CarriedColor                   blue              2

 

I hope it helps. 

Regards

Re: Accessing the MU within a transporter (AGV modelling)

Experimenter
Experimenter
Thank you for the fast answer!

I think I know where you're going with it.. But the MU is attached to the AGV in an AssemblyStation. So if I am to create a method for changing the attribute of the AGV according to the attribute of the MU, how do I address them seperately?

Re: Accessing the MU within a transporter (AGV modelling)

Legend
Legend

You can attach the method in the Entrance Control of your AGV. 

And when your MU will be transfered on your AGV, the Entrance Method will be woke up in order to change the "CarriedColor" attribute. 

The Entrance Method will look like this : 

 

is 
do
      
local myMU : object := @ ; 
local myAGV : object := myMU.location -- (OR self.location if the Entrance method is one of the AGV's attributes). 

myAGV.CarriedColor := myMU.Str_color; 
-- (Str_color is an MU attribute when you create your MU you should affect the right value according to MU's color) ;

end;

Tell me if it's clear for you ! 

Re: Accessing the MU within a transporter (AGV modelling)

Experimenter
Experimenter

When I try to implement it, it gives me a syntax error at the line with 

myAGV.CarriedColor := myMU.Str_color; 

 Other than that, I think I start to understand how it works, but I don't know why it gives me a syntax error.

 

I will add my attempt to implement your solution.

Re: Accessing the MU within a transporter (AGV modelling)

Legend
Legend
You have a syntax error because you forgot ";" in myMU declaration line.

Re: Accessing the MU within a transporter (AGV modelling)

Experimenter
Experimenter
I finally got it to work the way I wanted it to. Thank you so much for your help!