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
|
|||
|
|||
Label logic for knowing distance
Hi all
How to use label for knowing the distance travelled by flowitem from source to sink? Kindly give the logic like which command to use, where to use it and how to how to know the distance.. we are unable to do it.. |
#2
|
||||
|
||||
|
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
shivrash (02-05-2012) |
#3
|
||||
|
||||
Hello,
if you use the variant with the command distancetotravel on the Onload-Trigger of the Taskexecuter (e.g. Operator), the following code querries the destination and uses that command. Code:
//*** costumer code *** treenode curtasksequence = gettasksequence(current,0); // active tasksequence treenode destination = gettaskinvolved(curtasksequence,4,1);// data on the 4th task // of the standard tasksequence // of the first parameter: // querry the travel task double distance = distancetotravel(current,destination); |
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
Zhang Guomin (05-15-2016) |
#4
|
|||
|
|||
hi vogel,
In my project I need to know the distances travelled by the components which are moved by an operator manually using a trolley. I've checked out the properties of an operator; there is no distance to travel in drop down menu on the Onload-Trigger. Where should this code be incorporated? |
#6
|
||||
|
||||
Maybe I can give you a hint until Jörg answers your questions. There are 2 ways to include code to a trigger. First is by using an option of picklist. Otherone is to push last button behind the trigger. The second way even can show you what picklist has done allready. And you could use it this way to understand how Flexscript works.
__________________
Hemmi |
The Following 3 Users Say Thank You to Sebastian Hemmann For This Useful Post: | ||
shivrash (02-05-2012) |
#7
|
||||
|
||||
Thank you, Sebastian.
Here ist the answer to Naveen first of all your items need a label to store the distance. Use "Create and Initialize Label... " from the picklist: object = item; Label[name] = e.g. "distance"; value to initialize "0". you can use the OnEntry-Trigger of the Object that receive the flowitem before the first transport or OnCreation in a source. In the OnLoad-Trigger of your Taskexecuters, which are involved with the transports, use the code of the post. the following code enhances the previous. Code:
//** enhanced code ** treenode distancelabel = label(item,"distance"); //node of the label "distance" in the item inc(distancelabel,distance); // similar to get labelvalue, add new distance, write new value Jörg |
The Following 5 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
sravan kumar (06-10-2015) |
#8
|
|||
|
|||
Quote:
hi vogel, Kindly elobarate with regards to the following post you made previously You get with the command getlabelnum(item,"distance") the value of the Label on your item e.g. at a sink. There you can write it to a global table "Add Row and Data to GlobalTable" and show your results in a Visual Tool or Recorder. with referece to your above post where should this command be used; is it in sink or flowitem etc.., regards, p.naveen kumar |
#9
|
|||
|
|||
hi jorg,
I've tried out a trial for my manufacturing simulation using the logic that you have given. Herewith I've attached the model, but I'm not able to see the output. Kindly have a look at the model and give me your suggestions. thanks, p.naveen kumar |
The Following User Says Thank You to naveenkumar For This Useful Post: | ||
SayedMohammad Ayati (05-13-2016) |
#10
|
||||
|
||||
Sorry, Naveen
i have expected to much knowledge on Flexsim script coding. Copy the the code to the objects: Source OnCreation Code:
treenode item = parnode(1); treenode current = ownerobject(c); int rownumber = parval(2); //row number of the schedule/sequence table { //************* PickOption Start *************\\ /**Create and Initialize Label*/ /** \nObject: */ treenode involved = /**/item/**/; /** \nLabel: */ string labelname = /**/"distance"/**/; /** \nValue: */ double newvalue = /**/0/**/; /**\n\n*/ addlabel(involved,labelname); setlabelnum(involved, labelname, newvalue); } //******* PickOption End *******\\ Code:
/** customer code */ treenode current = ownerobject(c); treenode item = parnode(1); //** enhanced code ** //*** costumer code *** treenode curtasksequence = gettasksequence(current,0); // active tasksequence treenode destination = gettaskinvolved(curtasksequence,4,1);// data on the 4th task // of the standard tasksequence // of the first parameter: // querry the travel task double distance = distancetotravel(current,destination); treenode distancelabel = label(item,"distance"); //node of the label "distance" in the item inc(distancelabel,distance);// similar to get labelvalue, add new distance, write new value The number value you want to write to a row in the global table is: getlabelnum(item,"distance") Jörg |
The Following 4 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
shivrash (02-05-2012) |
#12
|
||||
|
||||
Quote:
I've try to do other application. I want to caculate the distance between the Queue. So I modified curtasksequence = gettasksequence(current,1) and destination = gettaskinvolved(curtasksequence,1,1) in operator's trigger. But I get the strange result. |
The Following User Says Thank You to Nicky Yen For This Useful Post: | ||
SayedMohammad Ayati (05-13-2016) |
#13
|
||||
|
||||
Hello Nicky,
what have you built is a symmetric model. You should build an asymmetric one. Every network node should have a unique distance to its neighbors. Only this way you can see, if your results matches your expectations. The distance to travel consists of the travel on the network and the Offset-travel. Further on you querry always the travel distance to the next item to load. But if you load the last item to the maximum content of your taskexecuter your next destination is the sink. It is the unloadstation of your active tasksequence. Jörg |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
SayedMohammad Ayati (05-13-2016) |
#14
|
||||
|
||||
Hello Nicky,
please have a look at the command: getnetworkdistance Jörg |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
SayedMohammad Ayati (05-13-2016) |
#15
|
|||
|
|||
distance with condition
Hi,
according to your last threads, I have to set a condition which force the task executer back to certain object. my problem is that I can not set this condition. for instnce, I would after each 100m the task executer back to certain object. how can I do that? |
#16
|
||||
|
||||
Hello SayedMohammad,
that is a bit complicated, because your independent variable is the distance and not the time. The discrete flow simulation is typically time based. The engine creates future time events. But distance based events depend on that nothing accidentically happens in your model run. But you could open another thread, wherein you can discuss and develop a distance controlled process flow method, because in a time based simulation you can only check, if a traveled distance becomes greater than a defined value. But Process Flow has the ability to wait until a value reaches a defined level. But I am not an expert on the new process flow structure to give a starting hand. Jörg |
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
SayedMohammad Ayati (05-13-2016) |
Thread | Thread Starter | Forum | Replies | Last Post |
Where can I find or get the information about the travel distance of each yard truck? | syseo | Container Terminal (CT) Library | 0 | 02-12-2011 12:24 AM |
Push logic for warehouses | Alberto Serra | Q&A | 1 | 10-23-2009 03:12 AM |
Question about Transporter Logic | Alberto Serra | Q&A | 3 | 10-20-2009 06:10 AM |
Keeps a distance | Li Chin | Q&A | 3 | 12-18-2008 02:09 AM |
How to dynamically set virtual distance for Network Node | Sung Kim | Q&A | 2 | 02-29-2008 01:36 PM |