How data in Global Table can be added to Advanced AGV templete to load & unload

AjayManneni
Not applicable
2 Views
14 Replies
Message 1 of 15

How data in Global Table can be added to Advanced AGV templete to load & unload

AjayManneni
Not applicable

[ FlexSim 22.2.2 ]

Hello all,

Now I am using the default Advanced AGV template for my work (one in the below pic)

1673249356522.png

As part of my work I created a two coloumns of pickup and drop off locations in my global table

1673249620080.png

Now I would like to add the above global table data of pickup locations in load process (in below pic) and droffoff locations in the unload process (in below pic )

1673249569783.png

When i assigned this global table in unload process AGV is not recognising the desinations

Please, can anyone suggest me how to solve this issue

0 Likes
Accepted solutions (1)
3 Views
14 Replies
Replies (14)
Message 2 of 15

moehlmann_fe
New Member
New Member
Accepted solution

The AGV Process Flow Templates use control point connections to refer to pickup and dropoff points (as well as other types), as is explained in the tutorial.

If you want to automate the process of adding those connections than you can use the commands below the model reset trigger to adjust the connections based on the data in the table.

/* Add a connection; connectionType should be the row of the wanted connection the "Control Point Connections" list in the AGV properties (for example 5 for pickup) */
function_s(fromPoint, "addConnection", connectionType, toPoint)

// Remove a connection; only works automatically if there is only one connection present
contextdragconnection(fromPoint, toPoint, "Q");
0 Likes
Message 3 of 15

AjayManneni
Not applicable

@Felix Möhlmann Thankyou very much for your answer. Could you guide me where I should add this code?

Should I have to add it into the Globallists/Dropoffpoints ? if so in to which expression lable I should attach the code?


0 Likes
Message 4 of 15

jeanette_fullmer88DK3
Autodesk
Autodesk

Hello @Ajay M,

From reading @Felix Möhlmann answer, I believe he intended you to put the code in a model reset trigger.

1673365329955.png

0 Likes
Message 5 of 15

AjayManneni
Not applicable

Thankyou very much @Jeanette F for your reply. I added the above code into Model reset trigger but it was showing an error in the below pic. Could you please help me?

1673423246429.png

0 Likes
Message 6 of 15

moehlmann_fe
New Member
New Member

Since you approached FlexSim Germany by E-Mail I got to see your model and now have (I think) a better understanding of what you want to achieve.

In terms of the AGV Process Flow template, Pickup and Dropoff Points are surrogate positions that allow an AGV to load/unload at multiple different control points per location. My original answer assumed that your question was aimed at this.

If I understood your model correctly, your goal is to just determine the destination of the item, depending on where it was loaded from, correct?

To do that, I would not change the Process Flow at all. It assumes that the target destination of the item is present as a label called "destination" on the item. So what you can do is write that label onto the item in the "On Exit" trigger of the queues, by searching for the row that contains the current queue in the "PickUpPoint" column and writing the corresponding "DropOffPoint" value to the label.

// Find destination from table
Table PP1 = Table("PP1");
int row = PP1.getRowByKey(current.name, 6);
item.destination = Model.find(PP1[row][7]);


There are also some more issues in your model:

- Every control at which an AGV might end up at after a task should have a "NextWorkPoint" connection, so the AGV continues to travel after the task is done. Otherwise it would get stuck.

- The Process Flow only looks at the first connection of any type. So a control having more than one "NextWorkPoint" connections will not have any effect. The Process Flow template is build on the assumption that those connections form a loop, with outlying points being incorporated through work forwarding.

- You also have to make sure that only a single AGV can enter dead end paths at a time, otherwise the AGVs might cause a deadlock situation. You can use a control area for this.


I'll attach a modified version of your model, I hope that is Ok. Items are only created at P2 and are transported between the queues Q2, Q4 and Q8. Other rows in the PP1 table contain queue names that are not actually present in the model (Q5, Q7), so I left those out for now.

The relevant queues have the On Exit trigger set and the AGV Process Flow was replaced by a new, unaltered one.

Discussion2_1.fsm

0 Likes
Message 7 of 15

AjayManneni
Not applicable

Respected @Felix Möhlmann

Your response is really fantastic! Yes, my objective is to determine an item's destination depending on where it was loaded.

Your logic almost answered my problem, but I have one more question for you.

I created two flow items in the above model and allocated them to different processors.

If you look at this model, Processor P1 processes two different flow items at the same time, and Q1 receives both flow items.

1673432115495.png

And these both flow items have different destinations where they should reach

Here in this model discussion2-1_2flowitems.fsm

Flowitem 1 loaded from Q1 and its Destination is D1 and

Flow item 2 loaded from Q1 and its Destination is Q5

I modified your logic in 'On Exit' trigger of Q1 to achieve the above scenario, instead AGV is delivering both the items to Q5

Could you please help me in solving the above scenario?




0 Likes
Message 8 of 15

moehlmann_fe
New Member
New Member

You need a second identifier, so that you can find the correct row if there are multiple entries for the same PickUpPoint.

In the attached example I use the "Article" column/label for this. I modified the Exit trigger of Q2 to use an SQL query to find the correct row. For this it was necessary to change the column headers, since the square brackets are part of the SQL syntax.

Furthermore I then noticed that there has to be a small change in the AGV Process Flow after all. If an AGV does not fully load at a PickUp point, it would continue on the NextWorkPoint loop and never reach unload the items, if the destination was not part of the work loop.

To fix this, I altered the "Loaded Items" list slightly by adding another field that contains the WorkForwarding point of the destination if there is one.

1673435399555.pngUsing this in the query then allows to start the unloading when the AGV arrives at either the destination point itself or the WorkForwarding point of the destination.

1673435420328.png

Discussion2_2.fsm

0 Likes
Message 9 of 15

AjayManneni
Not applicable

Respected @Felix Möhlmann Thankyou once again for your explination.

I looked through your SQL syntax and it works great when there is only one global table containing data for pickup and dropoff locations.

In response to my previous comment, I created two flow items, Item 1 using the global table PP1 and Item 2 using the global table PP2.

1673442577650.png

Because my two flow items differed in physical properties or dimensions, such as the size of flow item 1 is not same to item2, I utilized two separate global tables.

As a result, item 1 has its own pickup and dropoff points in the columns of the PP1 global table. Similarly, item 2 has its own destinations in PP2.

Wich means a same Q receives two different flowitems with same or different destinations. Sometimes, a destination could also be a pickup point as well for another item

just an example

1673443739373.png

In the above SQL syntax, you are calling/looking up in just one global table PP1, but I would want to know the logic for looking up two tables....that is, in the 'On exit trigger' of Queue in below image.....how can we assign data from multiple global tables instaed of one?1673442238764.png

0 Likes
Message 10 of 15

moehlmann_fe
New Member
New Member
You can use the UNION keyword in SQL to connect multiple queries together. (SELECT ... FROM X ... UNION SELECT ... FROM Y ...)

If you have a label on the item that identifies which table it belongs to, you can also just use an if-statement and the original logic where you just look for one row.

if(condition)
{
    // Look in PP1
}
else
{
    // Look in PP2
}
0 Likes
Message 11 of 15

AjayManneni
Not applicable

Respected @Felix Möhlmann

I tired to replicate your orginal logic into the above hint you given into Q2

When AGV loading the second flow item which is in blue Colour i am addressing a lot of errors (in below pic)

1673509513908.png

Could you please check the model discussion2-2_logic_error.fsm where i am doing wrong? it got compiled but while doing the Simulation to run i am addressing the above errors

discussion2-2_logic_error.fsm

0 Likes
Message 12 of 15

jason_lightfootVL7B4
Autodesk
Autodesk

It doesn't find Q2 in column 6 of PP1.

Also your logic tests for !port in both branches of the if statement.

If you want to know what your code is doing put a breakpoint in it and step through the lines observing the local variables.

0 Likes
Message 13 of 15

moehlmann_fe
New Member
New Member

You didn't use a condition that identifies which table the item belongs to.

The idea would be to define a label on the items that show which table they belong to and then check label in an if-statement.

Alternatively, you could also write the correct table name to a label directly and use that in the trigger.

1673510691526.png

1673510661799.png

discussion2-tableNameLabel.fsm

0 Likes
Message 14 of 15

AjayManneni
Not applicable

Respected @Felix Möhlmann

Thank you very much it is working well. Your logic and answers both are fantabulous !!!


0 Likes
Message 15 of 15

AjayManneni
Not applicable

@Jason Lightfoot Thank you for your response. Now I understood how code works.

0 Likes