question

Michael O'Connell avatar image
0 Likes"
Michael O'Connell asked Michael O'Connell commented

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

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

FlexSim 16.1.0
agv path
tjozf.png (230.6 KiB)
agv-nextcp.fsm (18.8 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

·
Sam Stubbs avatar image
1 Like"
Sam Stubbs answered Michael O'Connell commented

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.

· 3
5 |100000

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

Michael O'Connell avatar image Michael O'Connell commented ·

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 0 ·
Sam Stubbs avatar image Sam Stubbs ♦ Michael O'Connell commented ·

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.

1 Like 1 ·
Michael O'Connell avatar image Michael O'Connell commented ·

Thanks, Sam. Just getting it as a reference.

0 Likes 0 ·

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.