question

Michael Kramer avatar image
0 Likes"
Michael Kramer asked Lucas Klein edited

How can I programatically read a TEs total travel distance?

I'd like to read and use a TEs travel distance in a custom function. How can I do that for Conveyance01?

(I tried dong a search of the forum before posting my question but I keep getting this error: search-error.png).

totaltraveldist.png

FlexSim 17.0.2
task executertravel
totaltraveldist.png (47.1 KiB)
search-error.png (69.2 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

Lucas Klein avatar image
3 Likes"
Lucas Klein answered Lucas Klein edited

Hi @Michael Kramer

The total travel distance is a variable on the AGV object. So you can simply use the code below to access it data:

treenode AGV = model().find("Conveyance01"); //References the AGV 

//Get the variable data in a double var "distance"
double distance = getvarnum(AGV, "totaltraveldist");
return distance;
· 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.

Michael Kramer avatar image Michael Kramer commented ·

@Lucas Klein, thank you!

0 Likes 0 ·