question

IT Asset avatar image
0 Likes"
IT Asset asked Cameron Pluim commented

Trouble accessing currentCP property for AGV object

I'm trying to access the current CP for my AGV but when I use the new dot syntax the result is always null. However it works when I use the deprecated commands.

What am I doing wrong that the dot syntax isn't working correctly?

I'm attaching a picture of the code here and will post a copy of my model privately.

FlexSim 17.2.2
agvdot syntax
picture2.png (52.1 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

Phil BoBo avatar image
2 Likes"
Phil BoBo answered Cameron Pluim commented

The AGV data of an object is retrieved by using the following syntax:

AGV vAGV = AGV(token.resource);

You cannot cast a treenode or a Variant directly into an AGV. The AGV data is a separate node that holds data about the task executer in the AGV Network that is related to the task executer but on a different node. So the syntax is a little different.

You can find an example of this syntax at the top of Way Point triggers.

· 1
5 |100000

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

Cameron Pluim avatar image Cameron Pluim commented ·

Hey @phil.bobo, Can this example be added to the documentation for AGVs? Ideally within the Static method, or in the description of the AGV Type.

1 Like 1 ·