question

Mehdi K2 avatar image
0 Likes"
Mehdi K2 asked Jeanette F commented

Travel A Truck from Control point 1 to 2 by flexScript

Hi,

I have a model with a path and control point. I strongly need just a Piece of code ( Not Process Flow Block) that helps me to Travel a Truck (or AGV) from control point 1 to control point 2.

please see the attached model. I need to Travel the Truck from Cp1 to Cp2 by "Command".

Thanks,

depot (3).fsm

FlexSim 19.0.0
agvflexsim 19.0.0travelcontrol pointcommand
depot-3.fsm (21.3 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

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Jeanette F commented

TaskSequence create method: there is an example code.

Instead of TASKTYPE_LOAD, item, current you use

TASKTYPE_TRAVEL, obj Cp2, NULL

Where “obj Cp2” is a pointer to Cp2

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

Mehdi K2 avatar image Mehdi K2 commented ·

thanks,

But It's not Worked for me!

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Mehdi K2 commented ·
treenode ControlP = Model.find("CP2");
TaskSequence ts =TaskSequence.create(token.Train,0,0);
ts.addTask(TASKTYPE_TRAVEL,ControlP,NULL);
ts.dispatch();

Sure it does work! But only for the first TE, any other TE need an allocateable Control Point ahead.

1 Like 1 ·
Mehdi K2 avatar image Mehdi K2 Joerg Vogel commented ·

thanks @Jörg Vogel for Response,

Now my problem is :

How can I make sure that the next code is activated after the truck arrives at its destination?

0 Likes 0 ·
Show more comments

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.