question

iceagesimulator avatar image
1 Like"
iceagesimulator asked iceagesimulator commented

Move AGV to another spot not on AGV path

I have a weird model where AGVs only have one travel use (meaning they travel from one centerpoint to another once, and then they are no longer needed). Then once they reach the end of their travels they are no longer needed in the model. I tried destroying the AGV (taskExecutor) with FlexScript and then also tried the "Destroy Object" in process flow, however that may have been too extreme, since there were a few errors related to OnPreDraw.

I will be happy with the AGV just being moved to a different part in the model (off screen). So I have tried the "Move Object" process flow activity, and then also tried moving it with FlexScript. I do not care what the AGV needs to move to (either another control point, or another 3D object like a queue, or even an x,y,z coordinate). I just need the AGV to move off the AGV network path and to somewhere else in model, because I need to make room for other future AGVs to take up space on the network path and control point. At the end of the AGV travels, I cannot have the AGV relocate itself by "traveling along another AGV network path". I really need to have the AGV leave the model or appear to leave the model.

I am wondering if I need to detach the AGV task executor from the Object Process Flow before I try to manually move it? I am also wondering do I need to deallocate the AGV manually from the control point before it is manually moved?

Attached is a simplified version of my model that I am working on.

1703269467063.png

1703269504499.png

ManuallyMoveAGVWhenDoneWithTravels.fsm

FlexSim 24.0.0
agvmoveobject
5 |100000

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

Jeanette F avatar image
0 Likes"
Jeanette F answered iceagesimulator commented

Hello @IceAgeSimulator ,

I have a few solution for you to consider.

When you were trying to delete the AGV after the travel I believe the errors you were running into were due to the arrival events not finishing entirely before deleting. If you look at the event list you will see that when there is an end speed there is an arrival event and the token finishes the task activity but there are still a traversal event and another arrival event.

If the end speed is set to zero you can destroy object right after.

1704396801358.png

AGV finish travel with zero end speed and delete.fsm

When you have an end speed I add in a wait for event to check for the last arrival event before deleting the agv.

1704396903741.png

AGV finish travel with Non-zero end speed and delete.fsm

This is also how the move object solution is set up but instead of disconnecting the AGV I remove the navigator.

1704396983571.png

manuallymoveagvwhendonewithtravels-v2_1.fsm



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

iceagesimulator avatar image iceagesimulator commented ·
Thank you so much! Your first solution of having the AGV set its speed to 0 before getting destroyed worked well. Your third solution of the using the Wait for Event and then disconnecting the AGV from the navigator also worked well. I could not get your second solution to work, with destroying the AGV after the Wait for Event. But I will take the first and third solutions as a success! Thank you.
1 Like 1 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered iceagesimulator edited

A taskexecuter becomes a member to an AGV somewhere. You must do it in opposite direction. If you have connected a taskexecuter by a drawing a line from a control point object to your vehicle then you must delete this line by a command. Try it with contextdragconnection.

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

iceagesimulator avatar image iceagesimulator commented ·

I added the contextdragconnection command right before the moveobject command. This is called in the AGV process flow:

contextdragconnection(Model.find("TaskExecuter1"),Model.find("ControlPoint2"),"Q");
moveobject(token.agv,Model.find("CP_Exit"));

When the code is fully executed I get the following error:

time: 11.097023 exception: Exception caught in Executive::processeventinlist().

time: 11.097023 exception: Exception caught in Executive::processeventinlist().

time: 11.097023 exception: Exception Caught in ObjectFunction253__project_library_FlexSimObject_behaviour_eventfunctions_OnPreDraw object: /AGVNetwork class: /AGVNetwork


time: 11.097023 exception: Exception caught in TreeNode::receivemessage()

time: 11.097023 exception: EditorSpatial::prepareDraw()

--------

Also the AGV is not moved on top of the control point named "CP_Exit", but rather is offset by some distance to the left. See picture:

1703691624125.png

Even after going executing the contextdragconnection command with a "Q" connection, the Task Executor is still listed as attached (Attached Objects) to the AGV process flow.

Attached is the latest model version:

ManuallyMoveAGVWhenDoneWithTravels_V2.fsm

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.