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 10-03-2007
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default releaseitem command

When I call releaseitem command, is there any internal state associated with this item changed? I find it will cause big problem if I call releaseitem twice when a transportor is used. The transportor will get two task sequences for the same item. The Flexsim will crash when the transportor is not able to load the item when it arrives at the position the second time. More specifically, my question is, can I use some internal variable to tell if the item has been released, or I have to implement my own?

Thanks.
Alan
  #2  
Old 10-03-2007
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

You should not call releaseitem() on an item that has already been released (and if you're in a regular object like a Processor and use releaseitem(), you should make sure that the item is not released again by the Processor's normal releasing mechanism. You might accomplish this by destroying the Processor's events, but it is dependent on the point at which you want to do it, and it's not really encouraged to completely override a regular object's normal mechanism). To query whether an item is already released, use getitemstate(). If it's released, it will have either the FRSTATE_READY or FRSTART_MOVEREQUESTED state. You can call holditem() to "unrelease" an item, but you should only use holditem() when it is in the FRSTATE_READY state, and not in either of the other two states. Also refer to the FixedResource object's documentation in the user manual for a detailed description of the steps and states a flowitem goes through in a FixedResource.
  #3  
Old 10-04-2007
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: 684
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

Hi Alan,

I encountered the same problem somewhere and what I did was simply an if statement in the request transport from trigger just before I made the tasksequence. In the if statement I checked if this tasksequence was already created and if so I used "return 0" to get out of the trigger. I actually used a label to check if I already released the item, but with Anthony's answer you could do that easier.

It is not the most neat way of doing things but it worked.


Regards,

Steven
  #4  
Old 10-04-2007
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Thanks both of you for the suggestions. I guess the command getitemstate is what I need. Otherwise, I have to implement my own like what Steven did.

Anthony's explanation should be put into Flexsim user manual or Flexsim command help. Since releaseitem, holditem, and getitemstate these command are related and typically used together, adding a "See Also" section for each command in the command help will be really useful.

Regards,
Alan



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.