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
|
|||
|
|||
Task Sequences
Hi all
I hope someone can help me with a problem I get if I create a task sequence. At a certain event, i want to create a tash sequence with the FRLOAD. In this function I need to tell the op what item he must load from the queue #XY. My problem is at the time i create this task, i don't know which item he needs to fetch up. My idea was, to take this command.... first(Queue #XY) but my problem is if there is no item(because it will arrive in 5 sec or so..) I get a bad pointer. Can i tell the op in the FRLOAD to get any item. thanks Daniel |
#2
|
||||
|
||||
Take a look at the CALLSUBTASK. That task gives you the possibility to create a new FRLOAD at the moment you are actually loading.
|
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post: | ||
Gi Cha (09-16-2010) |
#3
|
|||
|
|||
Hi
thank you for your answer. I informed myself about the callsubtask by reading through your user guide. The one thing I don´t understand, is the last sentence of the following description: If you decide to create the task sequence when the TaskExecuter gets to the call sub task sequence.tasks task, then you will need to create the task sequence using createemptytasksequence(), and insert tasks using inserttask(), but do not dispatch the task sequence using dispatchtasksequence(). Simply return the reference to the How can i return this refernece an how do i get this reference. Which command do I need to programm? Can u give me a code example to help me through this problem ? I would very appreciate this. Thanks a lot Daniel |
#5
|
|||
|
|||
ok now i know how but,
a pointer to which task squence ? the Task Sequence in my main task or the one in my Subtask ? if i need to pointer at the task sequenz in my main task (as i thought) how do I access this treenode? if I just need to return the treenode of the subtask ...all easy thanks Daniel |
#6
|
|||
|
|||
Yes it's just a pointer to the new tasksequence of (sub) tasks - it's just so the calling code (part of the TASKTYPE_SUBTASK execution logic) knows what you've created without searching for it - since you're free to create it on any dispatcher.
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Daniel Schneider (09-20-2010) |
#8
|
|||
|
|||
Hi again,
still working on the task sequences of my projekt. The next problem I have is, that i want to create a travel sequence. But only if there is no active task sequnece in the dispatcher. Or so to say. If op is idle he should got to location the Queue#XY Any idea how i get the content of the active task sequences in the dispatcher? Or how to solve this problem I tried :>>>>>>content (Dipatcher/variables/tasksequneces);<<<<<< but does not work Thanks a lot Daniel |
#9
|
|||
|
|||
Look at the OnMessage and OnAvailable triggers of the transporters in the model posted here.
Last edited by Jason Lightfoot; 09-23-2010 at 06:20 AM. |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
shafizad (10-06-2010) |
#10
|
|||
|
|||
Hi i used the commands shown in this sample.. .it works , but i get a Error.
Code: OnMessage (triggered by Subtask): /**Check of new orders avail.*/ treenodecurrent = ownerobject(c); pt("Check if there is something to do for operators"); pr(); if(msgparam(1)==1) { treenode newts = createemptytasksequence(Dispatcher,0,0); if(not(objectexists(gettasksequence(Dispatcher,0)))){ pt("No order for op travel back to queue"); pr(); inserttask(newts,TASKTYPE_TRAVEL,centerobject(current,1),NULL); } else{ pt("New order for op "); pr(); } profiletasksequence(newts); return newts; } Error: time: 16013.336695exception: Exception Caught in gettasksequence(fsnode* dispatcher, double tsrank) time: 16013.336695exception: Exception Caught in ObjectFunction103__project_exec_commandlist_gettas ksequence_node object: MAIN:/project/exec/commandlist/gettasksequence/node class: MAIN:/project/exec/commandlist/gettasksequence/node Where is my mistake ? do I mistaken something ? Thanks Daniel PS: I use pt("") to debug and comment my code. I find i very usefull, cause you can see whats going on in your code, while the model is running. Reminds me of roboter contoller. |
#11
|
|||
|
|||
Does it build correctly ? You seem to have no space after treenode in the definition of 'current'.
As it's on a trigger I'd try using tonum(newts). To debug it just place a debugger breakpoint on a line by clicking in the margin (version 5 and above). |
#12
|
|||
|
|||
the missing space, is just a copy/paste error. In my code there is a space.
The code is working and the op's do what they are meant to do, but in the system console appears this error. I already debugged the trigger. At this point there ist he pointer to current and the pointer to the newts. but no variables. the function not(...) return what ??? In gernal such functions return data ..type boolean. Does Flexscript uses such a type? Or does 0 equals true and 1 equals false?? Thanks Daniel |
#13
|
|||
|
|||
Hello Daniel,
I think the way your code is setup, it will always create an empty tasksequence, but will only add a task, when there is no active task for the dispatcher. If there is an active task for the dispatcher, you use the profiletasksequence(newts) command for an empty task (no task is inserted), I think this may be the problem. I think you could solve this problem by only creating the newts when there is no active task: if(not(objectexists(gettasksequence(Dispatcher,0)) )) { treenode newts = createemptytasksequence(Dispatcher,0,0); inserttask(newts,TASKTYPE_TRAVEL,centerobject(curr ent,1),NULL); profiletasksequence(newts); return newts; } Esther |
#14
|
|||
|
|||
If you can't tell which line generates the problem by stepping though, you can use mpt(), mpf() and mpr() you can print to the same console as the error message and see exactly where you get the problem. Be sure to remove any of these statements before sending a model to Flexsim support though as they clutter the system console (I've been guilty of this before the debugger came along).
I usually add a dummy TASKTYPE_TAG to the task sequence rather than return an empty one or NULL, but it looks like returning NULL will also work. |
#15
|
||||
|
||||
Quote:
A 0 value on an int or double is "false". Any other value is "true". Just like C++. The function not() will return 1 if the expression inside resolves to 0. It will return 0 otherwise. You can use the ! symbol to do the same thing, just like C++. |
#16
|
|||
|
|||
I changed the code a esther said, but the error remains.
Thanks @ phil for the explanation concerning the True/false. I´m programming in java... I ve never learned C++ As the program is working I leave the code as it is... Other thing; A Questions concerning treenodes i have 2 stations and they are conected by treennodes. In the station i have a treenode every 1m. And between the two stations I have ony one treenode (distance about 100m). My worker has a max speed of 0.3 m/s. In the station the worker moves slowly and if he traveles to the other station he becomes very fast ?what is this ? Do in need to Place a treenode every meter ? How is the speed defined in flexsim ? thanks for support daniel |
#17
|
||||
|
||||
Daniel,
You speak about treenodes in your stations, but I guess you mean NetworkNodes, right? Or do you speak about FlowNodes? I assume that you speak about NetworkNodes. Normally the distance in Flexsim is measured by the grid, where 1 grid is 1 m. But there is also the possibility on a NetworkNode to give a virtual distance between nodes. This means, if the distance between the NetworkNodes is e.g. 10 m in the grid, you can give it a Virtual Distance of e.g. 100m. This means that the speed will be adjusted to this virtual distance. Maybe this happens in your model that you place them 100m away from each other, but your Virtual Distance is maybe only 10m. The speed in Flexsim is defined on the taskexecuter (Operator). But between NetworkNodes also a speed limit can be defined. This means that the Operator will not move faster than this speed limit, even if his speed is higher. You can get the current speed of an Operator with getvarnum(Operator,”maxspeed”). To set the speed you could use setvarnum(Operator,”maxspeed”,2.50). I am not sure what is going on into your model. But please check the above things. If they are not the source of your problem, it might be helpful, if you post your model here or a small model which shows the problem with the distance and speed.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following User Says Thank You to Tom David For This Useful Post: | ||
Phil BoBo (09-27-2010) |
#18
|
|||
|
|||
The problem with the networknodes, was solves by me by adding networknodes every 1 m.
It solved the Problem but as Tom David says this problem only occurs in my simulation.... By the way. Earlier we talked about felxscript and C++. How is it possible to divide in flexscript? If I divide 3 by 15 i want to get 0.2 If I do this division in flexscipt, I get 0. in c++(java) I would cast it into a double Can`t find any hint in the Flexsim Training Any idea? |
#19
|
|||
|
|||
Hi,
Flexscript get the result 0.2 when you do 3/15. How do you to see the result from the division? Printing using pd or pf? pd will only print as integer while pf is printing as real. Lars-Olof |
Thread | Thread Starter | Forum | Replies | Last Post |
About Coordinated Task Sequences | Normand Côté | Gripes and Goodies | 1 | 06-21-2008 06:08 AM |
Queuing coordinated task sequences? | Nico Zahn | Q&A | 19 | 04-02-2008 08:30 AM |