question

Pinakin K avatar image
0 Likes"
Pinakin K asked Pinakin K commented

How to restrict the entry of agv on agv path?

agvroute.fsm

In the above picture, i do not want the agv to travel on this path. But after like 5000 sec i want it to use this path. Is there any way to make this happen or any workarounds?

I know that putting a control point in the other route and directing the agv would work. but i do not want to do that.

Also i'm controlling the agv with only process flow.

FlexSim 19.1.1
agv path
agvroute.png (27.4 KiB)
agvroute.fsm (26.7 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

·
Joseph Gillespie avatar image
1 Like"
Joseph Gillespie answered Pinakin K commented

@Pinakin K

There isn't really a good way to do this without using control points. AGVs were designed around using them and any other workaround to solving this problem will run the risk of causing other problems with your model.

One potential workaround would be to reverse the direction of the path in question and then use custom code to turn it back in the correct direction after 5000 seconds, allowing the AGV to travel on it. Here is your model with this workaround: agvrouteanswer.fsm

Note that with this workaround the path doesn't become reversed again when you reset the model, so you will have to reverse it manually before running the model every time, or find some other way to reverse it every time you run the model.

Ultimately the best solution would be to just use control points. If you are having problems with control points, let us know and we'll be glad to help you out with your questions.


agvrouteanswer.fsm (29.0 KiB)
· 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.

Pinakin K avatar image Pinakin K commented ·

Thanks this might Work. But I am not familiar with the use of the command

function_s

So if i have to make it two way and then again turn that off usin code, how would i do it?

This would solve my issue of manually switching the directions.

0 Likes 0 ·
Joseph Gillespie avatar image Joseph Gillespie Pinakin K commented ·

@Pinakin K

Here's an updated version of the model that instead switches it to be two-directional:

agvrouteanswerupdated.fsm

I used this code to do it:

treenode path = Model.find("AGVNetwork/Path3");
setvarnum(path, "isTwoWay", 1);
function_s(node("/AGVNetwork", model()), "refreshMesh");
repaintview(activedocumentnode());

Essentially, this code goes into the FlexSim tree structure and changes the value of whether or not the path is two-directional or not.

Unfortunately, when you run the simulation a second time (when the path starts out two-directional) you'll run into a problem where the path switches back to one directional but the AGV still travels on it. The AGV module wasn't designed for changing path directions mid-run, so it would be difficult to find a way around this problem. Feel free to experiment with it some more, though ultimately I recommend just using Control Points.

1 Like 1 ·
Pinakin K avatar image Pinakin K Joseph Gillespie commented ·

Thank You! I decided to use control points, this did take some flexibility away, but it works for now. I would experiment the code that you provided and see how can i use it effectively.

1 Like 1 ·

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.