question

Nicholas Grazioli avatar image
0 Likes"
Nicholas Grazioli asked Jason Lightfoot answered

How to find the AGV behind another?

Hi,

I would like to know how to find one AGV that is behind another, on accumulation Path.

I tried to use the code below to read information about behindAGV on the agv node in the AGVNetwork variables,but I failed (the result is always 0), even though I can read other information, with the same code, such as resetPoint.

var behindAGV = getsdtvalue(agvNode, "behindAGV"); // Result = 0

There is anoher way to read it?

I leave a screenshot of the situation.

1649257740022.png


FlexSim 22.0.2
agvagvnetworkaccumulationagv accumulation
1649257740022.png (145.9 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered
Can you rework it so that you find the one ahead using agv.accumAheadAGV?
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Nicholas Grazioli avatar image Nicholas Grazioli commented ·

I tried, but I find myself in a strange situation where only the AGV in front has the information about the one behind. The AGV behind it has no information on who is in front of it (aheadAGV = NULL).

I am attaching some pictures and a model that show the problem.

allocation-error.pngagv1-info.jpgagv2-info.pngFind_BehindAGV.fsm

0 Likes 0 ·
agv1-info.jpg (907.3 KiB)
agv2-info.png (89.1 KiB)
find-behindagv.fsm (61.6 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ Nicholas Grazioli commented ·

Regardless of what you see in the sdt structure it still returns the agv ahead:

AGV agv=AGV(Model.find("AGV1"));
return agv.accumAheadAGV;

1649338755747.png

0 Likes 0 ·
1649338755747.png (8.8 KiB)
Nicholas Grazioli avatar image Nicholas Grazioli Jason Lightfoot ♦ commented ·
Thanks, it works.

I didn't try with accumAheadAGV, because I've always seen a NULL value in ahedAGV of the AGV1.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.