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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 11-11-2011
Christian Norregaard Christian Norregaard is offline
Flexsim User
 
Join Date: Oct 2011
Posts: 59
Downloads: 13
Uploads: 0
Thanks: 33
Thanked 14 Times in 9 Posts
Rep Power: 109
Christian Norregaard will become famous soon enough
Default Crane drop off position

Hi all.

I have a model, where I would like a crane to carry flow items between queues and processors. I have two problems I need to solve:

1) Whenever the crane picks up a flow item, it does so in the correct position, but whenever it drops off an item at a processor or a queue, it does it at a slightly wrong x/y pos.

2) Can I add files to the media file library in a way, so that the index number stays the same? I have had problems with flow items taking on the wrong shape after a 'change 3D shape' trigger.

If this subject has been posted before, I apologize. I searched the forum for a similar post, but found none.
Attached Files
File Type: zip Test.zip (481.4 KB, 167 views)
Reply With Quote
  #2  
Old 11-11-2011
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 324
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi,

For question number 2 look instead to use frames. It is much easier to use frames instead of change 3D shape.
Look in the help for Frames and the setframe command.

Lars-Olof
Reply With Quote
The Following 3 Users Say Thank You to Lars-Olof Leven For This Useful Post:
Christian Norregaard (11-11-2011), Jörg Vogel (11-11-2011), Kris Geisberger (10-16-2012)
  #3  
Old 10-14-2012
oliver xie oliver xie is offline
Flexsim User
 
Join Date: Dec 2010
Posts: 53
Downloads: 37
Uploads: 0
Thanks: 21
Thanked 11 Times in 7 Posts
Rep Power: 117
oliver xie is on a distinguished road
Default

HI all
Now i have came up with Question 1 above, but there is no answer to the Quetion 1. is there anyone can help to solve this problem?
Reply With Quote
  #4  
Old 10-16-2012
Matt Long Matt Long is offline
FlexSim Development
 
Join Date: Apr 2012
Posts: 66
Downloads: 37
Uploads: 29
Thanks: 2
Thanked 150 Times in 40 Posts
Rep Power: 186
Matt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of light
Default

There is an issue with 3D Media being assigned new indexes when other models are being used. This is why it is recommended in the picklist option for Change 3D Shape to set the index number using a global variable. So if I created a global variable called HorseShape which had integer data, then in the OnReset of the model I could put the following code:

HorseShape = getshapeindex("3DMedia\\Horse.3ds");

Then in your picklist option, you can set the shape index number to be HorseShape.
Reply With Quote
The Following User Says Thank You to Matt Long For This Useful Post:
Jörg Vogel (10-17-2012)
  #5  
Old 10-18-2012
oliver xie oliver xie is offline
Flexsim User
 
Join Date: Dec 2010
Posts: 53
Downloads: 37
Uploads: 0
Thanks: 21
Thanked 11 Times in 7 Posts
Rep Power: 117
oliver xie is on a distinguished road
Default

Is there anyone can answer the question 1?

Question 1: Whenever the crane picks up a flow item, it does so in the correct position, but whenever it drops off an item at a processor or a queue, it does it at a slightly wrong x/y pos.
Reply With Quote
  #6  
Old 10-19-2012
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 678
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

What the crane does is ask the queue where to place the products. As a user you don't have access to what the queue tells you so you have to solve it in a different way. The following 4 are possibilities I can think off:
1 translate the 3d model of the queue with the use of the Shape Factors -> Edit on the General tabpage
2 create your own tasksequence with traveltoloc or travelrelative commands
3 Create your won queue, based on the BasicFR and use your own pick/place offset to determine where the crane is travelling to
4 Use a small dummy and invisible queue, bring the product to there and move the productin into the actual queue and move this dummy queue around to the right position.
Reply With Quote
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post:
Jörg Vogel (10-19-2012), oliver xie (10-21-2012)
  #7  
Old 10-21-2012
oliver xie oliver xie is offline
Flexsim User
 
Join Date: Dec 2010
Posts: 53
Downloads: 37
Uploads: 0
Thanks: 21
Thanked 11 Times in 7 Posts
Rep Power: 117
oliver xie is on a distinguished road
Default

hi steven
thank you for your reply!
i think the four methods you provided are not the direct access to solve the problem. in order to slove the problem, i find the bottom code which decide the position where the crane would drop off a flow item. the code is something as following:

From:library->navigator->cppfunctions->navigator

FlexsimObject* destobj = &o(FlexsimObject, destination);
TaskExecuter* te = &o(TaskExecuter, traveler);
double maxradius = (max(destobj ->b_spatialsx, destobj ->b_spatialsy) / 2) + (te ->b_spatialsx / 2);

double relativeloc[3];
vectorproject(destination, destobj->b_spatialsx*.5, -destobj->b_spatialsy*.5,0, up(te ->holder), relativeloc);

double xdifference = relativeloc[0] - xcenter(te ->holder);
double ydifference = relativeloc[1] - ycenter(te ->holder);
double hordistance = sqrt(sqr(xdifference) + sqr(ydifference));
double travelpercent = max(0, 1 - (maxradius / max(.000001,hordistance)));
/*
pt(" maxradius ");pf(maxradius);
pt(" dx ");pf(xdifference);
pt(" dy ");pf(ydifference);
pt(" hordist ");pf(hordistance);
pt(" travelpercent ");pf(travelpercent);
*/
if(travelpercent == 0)
{
te->destinationarrival(0);
return 0;
}

// Create the navigation request
fsnode* newnode = restorenode(recycledtravelrequests(), node_v_activetravelmembers);
if(! newnode)
{
nodeinsertinto(node_v_activetravelmembers);
newnode = last(node_v_activetravelmembers);
nodealloc(newnode, sizeof(NavigatorRequest));
}
NavigatorRequest * newreq = &o(NavigatorRequest, newnode);


// Here I set the initial data on the travel request, like the reference to the traveler, the destination, the begintime, etc.
newreq->traveler = traveler;// set the
newreq->destination = destination;
newreq->begintime = time();
newreq->endspeed = endspeed;

treenode kinematics = te->node_v_kinematics;
double offsetloc[3] = {travelpercent*xdifference, travelpercent*ydifference, relativeloc[2]-te->b_spatialz};
//pt(" offsetloc ");pf(offsetloc[0]);pt(" ");pf(offsetloc[1]);pt(" ");pf(offsetloc[2]);pr();
double totaltraveldist = sqrt(sqr(offsetloc[0])+sqr(offsetloc[1])+sqr(offsetloc[2]));
newreq->totaldist = totaltraveldist;
te->v_totaltraveldist += totaltraveldist;
initkinematics(kinematics, te->holder,0,0);
double traveltime = addkinematic(kinematics, offsetloc[0], offsetloc[1], offsetloc[2],
te->v_maxspeed, te->v_acceleration, te->v_deceleration,
te->v_lastupdatedspeed, endspeed, time(), KINEMATIC_TRAVEL) - time();


in the code above, i find the variable maxradius is the key to solve the problem, i can change the maxradius value but it would be recovered by the standard code, so the code i changed would not take effect.

Now i want to create an user library which contain my custom navigator code to instend of the standard library and change the connection varible of queue object, but i have not did it.

so i want to get some advices in this direction.

i think the developer of this software maybe can develop the navigator to be an object like dispathcer , which contain a GUI where we can define some varialbes like maxradius and then decide where to drop off the flow item in an easier way.
Reply With Quote
  #8  
Old 10-22-2012
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 678
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

1: You can't change the navigator code unless you want to recompile entire session every time you open Flexsim again
2: I'm a very experienced Flexsim developer and I will NOT touch the navigator
3: Why do you think that a piece of code that is working for almost 10 years would not be right for you?

So please stop looking so deep and go for 1 of my solution which can solve your problem just fine.
Reply With Quote
The Following 3 Users Say Thank You to Steven Hamoen For This Useful Post:
Carsten Seehafer (10-22-2012), Jörg Vogel (10-23-2012), RalfGruber (10-22-2012)
  #9  
Old 10-22-2012
oliver xie oliver xie is offline
Flexsim User
 
Join Date: Dec 2010
Posts: 53
Downloads: 37
Uploads: 0
Thanks: 21
Thanked 11 Times in 7 Posts
Rep Power: 117
oliver xie is on a distinguished road
Default

hi steven
thank you for your advices
for the sofeware, i have respect for its bottom code and i cannot change its code. but i still think what i advise is right. because positions of all the drop off task to the FixedResource object are all controled by the navigator, but as an user i cannot control where to place item for all the key codes are all in the bottom codes. i have red the four advice you gave to me,but i think advice 1 is not suitable for drop off task from two or more directions. advice 2 is not suitable for the Frload task. advice 3 changes the object. and advice 4 makes the problem more complex. all in all, all advices you gave to me are not direct methods. i think all users who have used flexsim have came across this problem. At last i want to emphasize that i have respect for this software. i just ask for a little change.

Quote:
Originally Posted by Steven Hamoen View Post
1: You can't change the navigator code unless you want to recompile entire session every time you open Flexsim again
2: I'm a very experienced Flexsim developer and I will NOT touch the navigator
3: Why do you think that a piece of code that is working for almost 10 years would not be right for you?

So please stop looking so deep and go for 1 of my solution which can solve your problem just fine.
Reply With Quote
  #10  
Old 10-23-2012
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 678
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Quote:
Originally Posted by oliver xie View Post
hi steven
thank you for your advices
for the sofeware, i have respect for its bottom code and i cannot change its code. but i still think what i advise is right. because positions of all the drop off task to the FixedResource object are all controled by the navigator
Firstly no, not all is controlled by the navigator, it is at least a cooperation between the navigator, the taskexecuter and the object a TE is traveling to

Quote:
, but as an user i cannot control where to place item for all the key codes are all in the bottom codes.
Yes you can, and I gave you 4 options to do what you want without accessing the "bottom" code

Quote:
i have red the four advice you gave to me,but i think advice 1 is not suitable for drop off task from two or more directions.
Ok you are right about this one, that is only possible for very particular problem

Quote:
advice 2 is not suitable for the Frload task.
Why not!!! It is clearly that you haven't research tasksequence very much. You can make a testmodel in 30 seconds to see what it does and how it works, but instead you spend your time on diving into the base code. Try something first before you tell me that is not suitable. Ofcourse you can use all kinds of tasks also to load exactly from the location you want. And trust me, everything you do with tasksequences is easier then changing the navigators!

Quote:
advice 3 changes the object.
What kind of remark is that if you want to change the navigator!!!!. Again do your homework first. The basicFR is put into the library just for people like you that want to have full control over what their object is doing. It is ment to be changed and has all the extra triggers available to let you do what you want and much more.

Quote:
and advice 4 makes the problem more complex.
Well I don't find it very complex, I find it a perfect viable work around. Such solutions you will have to use a lot more if you are going to build simulation models.


Quote:
all in all, all advices you gave to me are not direct methods. i think all users who have used flexsim have came across this problem. At last i want to emphasize that i have respect for this software. i just ask for a little change.
Well as long as you haven't tried out the options that the software offers, but immediately want to change something I don't think you respect the software. Please make some demo models, show us here at the forum that you are trying to solve it yourself. Maybe we can help you change your models, but from your answers it doesn't look like you have tried anything yourself.
Reply With Quote
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Carsten Seehafer (10-23-2012)
  #11  
Old 10-24-2012
oliver xie oliver xie is offline
Flexsim User
 
Join Date: Dec 2010
Posts: 53
Downloads: 37
Uploads: 0
Thanks: 21
Thanked 11 Times in 7 Posts
Rep Power: 117
oliver xie is on a distinguished road
Default

Quote:
Originally Posted by Steven Hamoen View Post
Well as long as you haven't tried out the options that the software offers, but immediately want to change something I don't think you respect the software. Please make some demo models, show us here at the forum that you are trying to solve it yourself. Maybe we can help you change your models, but from your answers it doesn't look like you have tried anything yourself.
hi steven
i am sorry if i let you feel not good like words above!
let me clarify something here about what i am thinking of.
i just feel the advices you gave is not direct.

Quote:
Originally Posted by Steven Hamoen View Post
Why not!!! It is clearly that you haven't research tasksequence very much. You can make a testmodel in 30 seconds to see what it does and how it works, but instead you spend your time on diving into the base code. Try something first before you tell me that is not suitable. Ofcourse you can use all kinds of tasks also to load exactly from the location you want. And trust me, everything you do with tasksequences is easier then changing the navigators!
i admit the advice 2 will work fine to solve the problem and i am wrong. but i must add a TRAVELTO task or TRAVELRELATIVE task before every FRUNLOAD or UNLOAD task. and so the standard simple tasksequence will contain six tasks.
Quote:
Originally Posted by Steven Hamoen View Post
What kind of remark is that if you want to change the navigator!!!!. Again do your homework first. The basicFR is put into the library just for people like you that want to have full control over what their object is doing. It is ment to be changed and has all the extra triggers available to let you do what you want and much more.
because i use a lot of fixedresouce object which will get item from upstream object ,so if i take the advice 3,i must translate the codes in the fixedresouce to basicFR. i know it will work but need some work and the objects such as Queue and Processor will become the same kind of object.

Quote:
Originally Posted by Steven Hamoen View Post
Well I don't find it very complex, I find it a perfect viable work around. Such solutions you will have to use a lot more if you are going to build simulation models.
i believe advice 4 will work fine.but if the drop off task is from different directions i must change the position of dummy more frequently before the drop off task is created.

all in all
the advice 2,3 and 4 will solve the problem. but need some work. i just want to give an advice: if i can change the value of variable:
double maxradius = (max(destobj ->b_spatialsx, destobj ->b_spatialsy) / 2) + (te ->b_spatialsx / 2);

to
double maxradius = 0.0001;
i think all the problems will be done. i donnot want to change the bottom code ,because i cannot do it. so i hope to change the variable or something related in a front GUI. Maybe some developer can set a reference from the front GUI to the bottom code.
at last, thank you for your sincere advices steven!
Reply With Quote
  #12  
Old 10-24-2012
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 373
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

You can do what you ask with the existing gui. maxradius is calculated with the x- & y-size of your destination object and the x-size of your taskexecuter. You have to resize your objects. (If your are using a crane you should have a look into initializeoffset in the cppfunctions of the crane. It's a little bit different).

If you want a fast solution you should use the suggestions of Steven.

There are a lot of dependencies, only changing the navigator is not a solution!
Reply With Quote
The Following 2 Users Say Thank You to Carsten Seehafer For This Useful Post:
oliver xie (10-25-2012), Steven Hamoen (10-24-2012)
  #13  
Old 10-24-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 767
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Changing maxradius to 0.0001 had no correctional effect in my test model - why don't you post an example of what you're trying to do?

Also - take a look at this post as an example of making pickup and dropoff locations look better (using one of the methods Steven recommended). It's just an example, and uses the first flowitem to calibrate future movements (so ignore it).
Reply With Quote
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
oliver xie (10-25-2012)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how get item position in Conveyor LINWEIXU Q&A 2 08-16-2011 12:34 AM
position of a table cell in a gui Esther Bennett Q&A 1 04-14-2010 09:35 AM
Set Window position and size Nico Zahn Q&A 5 09-03-2008 02:09 PM
Crane Logic: How to find out what a crane currently is doing? Tom David Q&A 5 06-02-2008 11:57 PM
Set reset position Martijn van Oostenbrugge Q&A 1 02-25-2008 11:48 AM


All times are GMT -6. The time now is 08:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.