How can I get the next CP on an AGV's path

How can I get the next CP on an AGV's path

michael_oconnell
Not applicable
57 Views
4 Replies
Message 1 of 5

How can I get the next CP on an AGV's path

michael_oconnell
Not applicable

[ FlexSim 16.1.0 ]

I believed the agvinfo command would provide me with the next CP using the AGV_DEST_CP or AGV_INTERMEDIATE_DEST_CP parameter, but it doesn't.

In the attached model, the TE has a reset point/origin of CP2 and a destination of CP5. Upon reaching CP3, I would expect agvinfo would give me CP4 as next CP, but it doesn't. It returns the final destination, CP5.

CP4 does show as nextCPArrivalPoint, but I don't know how to access it. Am I missing a command or parameter?

agv-nextcp.fsm

2665-tjozf.png

0 Likes
Accepted solutions (1)
58 Views
4 Replies
Replies (4)
Message 2 of 5

sam_stubbsYXX86
Community Manager
Community Manager
Accepted solution

It doesn't appear that there is an aginfo value that returns the next CP easily. However, you can directly reference that variable in the AGV network in the agv that points to the next CP. I'd be careful using it, since directly influencing the tree can create problems in your model. But just for reference sake you can get that reference by executing code something along the lines of:

treenode agv = node("TaskExecuter10", model());
treenode nextCP = getsdtvalue(node(">variables/navigator/1+",agv),"nextCPArrivalPoint");
return nextCP;

This is what we put into the command line, and it seemed to return the correct CP.

Message 3 of 5

michael_oconnell
Not applicable

It return the correct CP for me as well.

What do you mean by "directly referencing"? Does using the code as part of some waypoint logic qualify? What are the implications?

What's the meaning of AGV_DEST_CP and AGV_INTERMEDIATE_DEST_CP then?

0 Likes
Message 4 of 5

sam_stubbsYXX86
Community Manager
Community Manager

I'm not sure about the meaning of AGV_DEST, other than it simply seems to be another way of referencing the final destination.

All I meant to say by being careful, is that the tree is the behind the scenes working of the model, so if you're using it simply to get a reference to an object it should be fine, but if you're trying to change the variable or alter the tree, it can mess things up if you don't know exactly what you're doing. That's all, it was just a warning for being careful.

Message 5 of 5

michael_oconnell
Not applicable

Thanks, Sam. Just getting it as a reference.

0 Likes