question

Ankith T avatar image
0 Likes"
Ankith T asked Jason Lightfoot answered

How to get the agv state information using custom code ?

Hi,


I used process flow to determine the operation of an AGV such as travel, load, unload. I would like to know what is the state of an AGV using custom code so that i can decide where my token needs to go next.


1677021244298.png

For example as seen in the attached image, the selected AGV is blocked. i would like to check that using the custom code in decide function.

FlexSim 21.1.5
agvcustomcodeagv state
1677021244298.png (39.4 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
1 Like"
Jason Lightfoot answered

If you agvs are members of an object process flow then the state can be found using:

current.stats.state().valueString   //returns eg.  "idle"

or

current.stats.state().value   //returns eg.  1  or STATE_IDLE

Otherwise substitute current with a pointer to your agv object - eg token.agv



5 |100000

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