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
|
||||
|
||||
Offset Travel
Can anybody explain me how to change the travel offset behaviors of standard object, for example a Transporter. I read the Offset Travel under the TaskExecuter in the help. It explain how it works for different TEs. But it did not give me clues how to change the offset behavior. I would like to have a transporter unload to a rack with the following sequence. Go parallel along the rack x direction to the right bay, turn 90 degree to face the rack, forward, and then unload. Is it possible to modify the Transporter default Offset behavior to do this? Or is there any alternative?
Thank you very much.
__________________
Best, Alan |
#2
|
||||
|
||||
The offset travel is not easy altered while it's defined on the object in the library. An alternative is to start with a BasicTE and define the offset travel you would like on the triggers (define kinematics on the begin offset, alter update offset, etc). A problem is you want the forks to be seen and act like in the Transporter. You can view the tree library of the transporter and check the cppfunctions (OnDraw, OnPreDraw) under the behaviour node and try to extract the functionality. You also have to make sure your loaded item acts in the z-direction. It's some work to figure it all out. Hope it helped you on the way.
Martijn |
The Following User Says Thank You to Martijn van Oostenbrugge For This Useful Post: | ||
AlanZhang (04-16-2008) |
#3
|
||||
|
||||
I have thought about making a transporter starting from a BasicTE but not sure how much work that would be, especially the visual part. It is like to invent a wheel again. So I wonder it may exist a better solution. Thank you for the clue on where to find those code.
__________________
Best, Alan |
#4
|
||||
|
||||
One quick question. The behavior node of a transporter dragged from the library contains no code under cppfunctions. But the transporter in the library has the code you mentioned. This mean all transporters share the same behavior, right? Can I overwrite the default transporter behavior by adding code under cppfunctions of a transporter already dragged into the model?
__________________
Best, Alan |
#5
|
||||
|
||||
Alan,
With what you want to do you're probably going to have to use a BasicTE. If you want a good place to start you can view the Open Pit Demo in the Demo Mining Models thread. The Front Shovels and Excavator in that model use nested BasicTEs to create the machines and animate them. It is a lot like reinventig the wheel but you're asking for something that I personally can't think of a way around. Sorry not to be of more help but the Open Pit model should help a lot if you go the BasicTE way. If not hopefully someone else will have some insights. Here is a link to that thread: http://www.flexsim.com/community/for...read.php?t=304 Good Luck, Brandon
__________________
thats not normal. Last edited by Brandon Peterson; 04-16-2008 at 02:52 PM. Reason: added link to demo model |
#6
|
||||
|
||||
Alan,
I believe adding the code under the cppfunctions would have to be done in the library. If you do that you should make a copy of the object you want to modify and give it another name. After you modify it you will need to compile the entire session and save the model as a project or session so that you save the library. Brandon
__________________
thats not normal. |
#7
|
||||
|
||||
Thanks, Brandon. I guess I have to invent one of the standard Flexsim object at least once in order to better understand how these objects works. And then I may know what is possible and what is not.
__________________
Best, Alan |
#8
|
||||
|
||||
Demo's are always nice to learn from, so that'll help! I've added a model with a start for the BasicTE. It's far from the end result, but it's a start. Good luck.
Martijn |
#9
|
|||
|
|||
It sounds to me like you don't want to edit the transporter, you just want it to travel the X offset separate from the Y and Z offset. This can be done by making a custom tasksequence when you call the transporter. I attached a model where I just changed the "request transport from" trigger with a tasksequence that does this. Is this kind of what you're looking for?
|
#10
|
||||
|
||||
Hi Alex,
This is interesting. Your method is similar to what I thought. I actually tried the method . At that time, I stored the bay and level in labels since I do not know the placeoffsetx() command and the bay is stored under the itemtype of items. And I calculate the offset location based on the rack location and bay number. What I found is when I use a network, placeoffsetx will not return the right number. So Transporter will travel to a wrong location. I also tried TASKTYPE_TRAVELTOLOC instead of TASKTYPE_TRAVELRELATIVE. It won't work either. I put some printout (in queue's RequestTransportFrom, rack's PlaceInBay and OnEntry) to study the execute order. From the output results, I know that the placeoffsetx command will triger "Place In Bay" of the rack. But when the item actually arrives at the station, the "Place In Bay" will be fired again and returns a different bay number. I also tried to put TASKTYPE_TRAVELTOLOC to the UnLoad trigger of the transporter. It does not work either. What I found is that if Travel Offset of thet transporter is selected, the UnLoad will be fired after PlaceInBay. This does not make sense to me. If the Travel Offset is not selected, the UnLoad will be fired before PlaceInBay. Please see attached model for transporter traveling on a network. If this method works, it will be a simpler solution and has potentials for other usages. Thank you for the help!
__________________
Best, Alan |
#12
|
||||
|
||||
This problem is not so difficult if you keep the following facts in mind:
|
The Following User Says Thank You to Cliff King For This Useful Post: | ||
AlanZhang (04-17-2008) |
#13
|
||||
|
||||
Alan, no worries. This is a far quicker solution to your problem, so definitely use it. I've checked your model. The offset which you define, you define in respect to the queue, but the moment the Transporter starts its offset, the transporter is at the networknode. You should use the network node as the unload station for the offset (see attached model), then it works.
Martijn |
The Following User Says Thank You to Martijn van Oostenbrugge For This Useful Post: | ||
AlanZhang (04-17-2008) |
#14
|
||||
|
||||
Thanks, Cliff and Martijn. The problem solved. And this is really a nice example on how easy of changing the default behaviors of standard Flexsim object. I am glad that we have such flexibilities in Flexsim. Besides, it helps me to understand the travel offset and the difference when a network is used or not. Perhaps, this could be summarized as a Wiki article later.
Thanks again!
__________________
Best, Alan |
#15
|
||||
|
||||
Hi, Martijin,
It seems this post cannot be closed yet. If I change the queue to rack, the behavior of Transporter is not right any more. The Place In Bay will be called twice for the same item so you get two bays at different time (say bay a and bay b). And the transporter will firstly go to the bay a at the order of offset x, then y, then z. But it will go to bay b since that is the final destination bay for that item. Please see the attached model for details.
__________________
Best, Alan |
#16
|
||||
|
||||
Alan,
I inserted some exra code in the "Place in Bay" trigger so that it is looking to see if a "bay" label has been set on the item yet or not. This way it only selects the bay once. This required me to also put a label on the flow item and to put some code on the entry triggers of the objects to make sure that the bay label was set to 0. I've attached the model so that you can test out and see what I've done. Good Luck, Brandon
__________________
thats not normal. |
The Following User Says Thank You to Brandon Peterson For This Useful Post: | ||
AlanZhang (04-18-2008) |
#17
|
||||
|
||||
Hi Brandon,
This works. What I learned here is that racks have a different behavior (I am not sure why.) than other fixed resource objects such as queues. But it always has some solution if you can track down the problem. Thanks!
__________________
Best, Alan |