ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 01-31-2012
shivrash shivrash is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 43
Downloads: 9
Uploads: 0
Thanks: 37
Thanked 2 Times in 1 Post
Rep Power: 158
shivrash is on a distinguished road
Default 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  
Old 02-01-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

please have a look at my post:
http://www.flexsim.com/community/for...01&postcount=2

Jörg
The Following User Says Thank You to Jörg Vogel For This Useful Post:
shivrash (02-05-2012)
  #3  
Old 02-01-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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);
Jörg
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post:
Zhang Guomin (05-15-2016)
  #4  
Old 02-02-2012
naveenkumar naveenkumar is offline
Flexsim User
 
Join Date: Jul 2011
Posts: 42
Downloads: 12
Uploads: 0
Thanks: 19
Thanked 2 Times in 2 Posts
Rep Power: 110
naveenkumar is on a distinguished road
Default

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?
  #5  
Old 02-02-2012
naveenkumar naveenkumar is offline
Flexsim User
 
Join Date: Jul 2011
Posts: 42
Downloads: 12
Uploads: 0
Thanks: 19
Thanked 2 Times in 2 Posts
Rep Power: 110
naveenkumar is on a distinguished road
Default

hi vogel,

How to write a new code in the OnLoad-Trigger?

(There is no provision to include a new code into the drop down menu)


regards,
p.naveen kumar
  #6  
Old 02-02-2012
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

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  
Old 02-02-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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

Jörg
The Following 5 Users Say Thank You to Jörg Vogel For This Useful Post:
sravan kumar (06-10-2015)
  #8  
Old 02-04-2012
naveenkumar naveenkumar is offline
Flexsim User
 
Join Date: Jul 2011
Posts: 42
Downloads: 12
Uploads: 0
Thanks: 19
Thanked 2 Times in 2 Posts
Rep Power: 110
naveenkumar is on a distinguished road
Default

Quote:
Originally Posted by Jörg Vogel View Post
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
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.

Jörg

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  
Old 02-04-2012
naveenkumar naveenkumar is offline
Flexsim User
 
Join Date: Jul 2011
Posts: 42
Downloads: 12
Uploads: 0
Thanks: 19
Thanked 2 Times in 2 Posts
Rep Power: 110
naveenkumar is on a distinguished road
Default

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
Attached Files
File Type: zip building logic.zip (38.9 KB, 87 views)
The Following User Says Thank You to naveenkumar For This Useful Post:
SayedMohammad Ayati (05-13-2016)
  #10  
Old 02-04-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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 *******\\
Taskexecuter (Operator) OnLoad Trigger:
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
Sink OnEntry Trigger
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)
  #11  
Old 02-05-2012
shivrash shivrash is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 43
Downloads: 9
Uploads: 0
Thanks: 37
Thanked 2 Times in 1 Post
Rep Power: 158
shivrash is on a distinguished road
Default

Thanks Jorg

Finally succeeded in showing the distance ..
The Following 2 Users Say Thank You to shivrash For This Useful Post:
SayedMohammad Ayati (05-13-2016)
  #12  
Old 02-07-2012
Nicky Yen's Avatar
Nicky Yen Nicky Yen is offline
Flexsim User
 
Join Date: Feb 2012
Location: Taiwan
Posts: 11
Downloads: 11
Uploads: 0
Thanks: 2
Thanked 1 Time in 1 Post
Rep Power: 100
Nicky Yen is on a distinguished road
Default

Quote:
Originally Posted by Jörg Vogel View Post
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 *******\\
Taskexecuter (Operator) OnLoad Trigger:
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
Sink OnEntry Trigger
The number value you want to write to a row in the global table is:
getlabelnum(item,"distance")

Jörg
thank you! Jörg
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.
Attached Files
File Type: fsm caculate distance between queue.fsm (43.9 KB, 88 views)
The Following User Says Thank You to Nicky Yen For This Useful Post:
SayedMohammad Ayati (05-13-2016)
  #13  
Old 02-08-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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  
Old 02-08-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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  
Old 05-13-2016
SayedMohammad Ayati
Guest
 
Posts: n/a
Downloads: 1
Uploads: 0
Question 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  
Old 05-13-2016
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.