question

jing.c avatar image
0 Likes"
jing.c asked Ben Wilson edited

AGV direction

Hi, forum

I want to know how to get the direction of agv.

You can see the attached model, agv will pass the CP4 form left or right. How can I know where is the agv come from?

Thanks in advance.

agv-directionv16.fsm

FlexSim 16.0.9
agvagv travel directiondirection
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
1 Like"
Michael Kramer answered Ben Wilson edited

@jing.chen, I rewrote it a bit because I like using process flow, but the basic code is in the user function "DirectionCoord." I also added a simple up/down counter to process flow if you use that.

· 4
5 |100000

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

Frenk Gao avatar image
0 Likes"
Frenk Gao answered jing.c commented
  1. treenode AGVNetwork=node(">variables/navigator/1+",agv);
  2. double start=getsdtvalue(node("/travelPath/1",AGVNetwork),"fromDist");
  3. double end=getsdtvalue(node("/travelPath/1",AGVNetwork),"toDist");
  4.  
  5.  
  6. if (start>end){
  7. //direction A
  8. }else{
  9. //direction B
  10. }

Create a Way Point Logic in the CP.

· 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.