ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Travel to homelocation
Hi all,
I want my TE to travel to a specific location when there's no tasksequence available. I tried to use the onresourceavailable trigger with "travel to a homelocation", but then the model stops when the TE arrives at this controlpoint (see attached model). How can I solve that problem and redirect the TE when there's a task available? Thanks in advance! |
#2
|
||||
|
||||
When I open the model and run it it crashes Flexsim completely.
And when I open it and look on the taskexecuter there is no code on the OnResourceAvailable. So not so easy to say anything about your model. Btw I use version 7.7.4 |
#4
|
||||
|
||||
Hi Johanna,
Connect control points(home locations) to the dispatcher with the 'A' key.A blue line will appear when the connection is made correctly. If you want to send it to a home location then in the on Resource available trigger you need to change the home location default centerobject(current,1) to inobject(current,1) because the AGV is connected to dispatcher through ‘A’ connection and the condition to send the AGV to home is content(gettasksequence(resource))==0 by default If the AGV does not have any tasksequence in the tasksequence queue then the AGV goes back to the home location.You need to change the code in the option travel to home location a bit to run the model.Here is the modified one. Code:
treenode dest = inobject(current, 1); int condition = content(gettasksequencequeue(resource))==0; if (condition) { // this prevents stack overflow (I only want to travel there if I'm not there yet) if (fabs(time() - getlabelnum(current,"f_travelhome_time")) > 0.01) { addlabel(current,"f_travelhome_time"); setlabelnum(current,"f_travelhome_time",time()); treenode ts = createemptytasksequence(resource, 0,0); inserttask(ts, TASKTYPE_TRAVEL, dest, NULL, 0, 1); // and for good measure to absolutely make sure it doesn't get into stack overflow // I do a delay of 0. Where otherwise stack overflow would occur, here the model // will simply not progress. inserttask(ts, TASKTYPE_DELAY, NULL, NULL, 0, STATE_IDLE); dispatchtasksequence(ts); return1; } } Last edited by sagar bolisetti; 02-26-2016 at 11:46 AM. |
The Following User Says Thank You to sagar bolisetti For This Useful Post: | ||
Johanna Klietz (02-26-2016) |
Tags |
agv, homelocation, taskexecuter |
Thread | Thread Starter | Forum | Replies | Last Post |
Set up end speed for travel | Yiheng Feng | Q&A | 2 | 05-27-2013 09:36 AM |
difference between offset travel and travel? | zhang xin | Q&A | 2 | 08-20-2012 07:11 AM |
the way of travel to the rack | Nicky Yen | Q&A | 4 | 04-16-2012 04:12 AM |
Problems with using "Travel to Homelocation" | Sebastian Hemmann | Q&A | 2 | 12-09-2010 05:57 AM |
Offset Travel | AlanZhang | Q&A | 16 | 04-18-2008 10:25 AM |