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
|
|||
|
|||
a question about changetask command
hello
i have used the command changetask to change some parameters of the active tasksequence, but the changed tasksequence did not take effect immediately. how can i improve this condition. thanks in advance! |
#2
|
||||
|
||||
Hello Oliver,
you can change parameters in a task, if the task is not begun. E.g. you can change the unloadstation of a frunload-task in the Onload-Trigger of a taskexecuter. Jörg Last edited by Jörg Vogel; 12-03-2014 at 03:23 AM. |
#3
|
|||
|
|||
hi Jörg
thanks for your reply! if i change your code as following on onload: senddelayedmessage(current,2,current,1,0,0); on message: treenode newstation = node("/Queue3",model()); treenode ts = gettasksequence(current,0); treenode loadeditem = gettaskinvolved(ts,2,1); changetask(ts,4,TASKTYPE_TRAVEL,newstation); changetask(ts,5,TASKTYPE_FRUNLOAD,loadeditem,newst ation,0,0,0,0); what i found is the changed travel task donot take effect when the message trigger was fired, the operator will travel to the first destination and then unload the item to the second destination. why did not the changed travel task take effect immediately?how can i make it done? |
#4
|
||||
|
||||
Hello Oliver,
your "immediatly" is delayed with 2 seconds. Then the task frunload might be begun. It is running. Now you can only abort that task. Then you can give the taskexecuter something else to do. Look Onmessage which task is active, e.g. profiletasksequence(obj. tasksequence) If I make the same changes as you did in my model, everything works still. Jörg |
#5
|
|||
|
|||
hi Jörg
maybe i did not express my real meaning clearly. my thought is like this: in the middle of travling process i want to change the operator' destination, so i send the delay message( 2 secnond later) after it frload the item and then change the active traveling task. with your advised command profiletasksequence, i found the operator is doing the traveling task before or after i change the task. so the task frunload task did not begin. but i find the operator did not take the changed travel task effect and still traveled to the first destination. when i add two command "stopobject" and "resumeobject" after the changing travel task code, the model works rightly. so i want to ask is there any commands to refresh the changed task and make it effect immediately when it's parameters were changed.the attached file maybe can help you to know what i want to do. ol.fsm |
#6
|
||||
|
||||
Hello Oliver,
please read my posts again.The commands stopobject and resumeobject don't work directly on taskexecuters, as you think. Stopobject creates a preempting tasksequence with high priority. The activets tasksequence is aborted and starts the current task on resume again. If you change that aborted and begun task during the stop and resume events, is the same as changing parameters on a not BEGUN task. The time is important, when you change something in tasksequences. Jörg |
#7
|
|||
|
|||
hi Jörg
you think if the task begins,we can not make the task which was changed after that time point effect? is this right? unless we abort that task and run the task again? is there no command to refresh the running task to have a new parameter and change the task running direction? |
Thread | Thread Starter | Forum | Replies | Last Post |
family command? | zhang xin | Q&A | 0 | 01-14-2010 06:33 PM |
a question about the command "getitemtype" | Vic Li | Q&A | 2 | 10-04-2008 11:47 PM |
Command getnextnetnodeoutport | Martijn van Oostenbrugge | Q&A | 0 | 02-22-2008 05:42 AM |
releaseitem command | AlanZhang | Q&A | 3 | 10-04-2007 10:11 AM |