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

  #21  
Old 08-11-2011
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

According the commandlist the portnr is optional so try it without first otherwise you can try with 0 or 1.
But where are you writing this code? Because if you do it on the Request Transport From the port is passed in as parameter.
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Chieng Kai Seng (08-11-2011)
  #22  
Old 08-11-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 109
Chieng Kai Seng is on a distinguished road
Default

Steven,

I'm writing it in sendto.
Tried all the options you said. None seems to work. I attach here a very simple model. Codes are at Source1/Flow/sentoport.

Cheers,
Chieng
Attached Files
File Type: fsm moveobjectModel.fsm (27.9 KB, 118 views)

Last edited by Chieng Kai Seng; 08-11-2011 at 06:43 PM.
  #23  
Old 08-12-2011
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

This will never work, the sendto requires a valid portnr to return. Why don't you use the port connections? Because without, the pulling will also not work.

Why is it that with the first model you want to build, you want to throw overboard all the standard (very simple to use, very robust and well designed) functionality of Flexsim and use your own? Stick to the standard unless we tell you to do otherwise!!

Anyway if you want to use moveobject and you don't want to use the port connections, return a -1 in the sendto and use the request transport from to write your moveobject. (I already mentioned to look at this trigger for an example of the code and that was not for nothing)
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Chieng Kai Seng (08-12-2011)
  #24  
Old 08-12-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 109
Chieng Kai Seng is on a distinguished road
Default

Steven,

Thanks for clarifying the issue!
One question, how do I reference a flowitem that has just been created? I use rank(current,ranknr) here but I have a problem when I want to do this for multiple queues at the modelTriggers/onModelOpen. Also, how do I get the flowitems to queue up nicely like it should when I use 'stack inside queue'?
I attach an example model. The codes are at Queue/Triggers/onReset.

Chieng
Attached Files
File Type: fsm insertcopy.fsm (27.0 KB, 105 views)
  #25  
Old 08-12-2011
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

Again, just use standard functionality. Put a source in front of a queue and select an arrival sequence and set the amount to 5 or whatever you want. Then you can use the standard queueing functionality because the items enter nicely.

I think that insertcopy actually returns a treenode being the one that is created but you should test that a bit. Otherwise "last(current)" also returns the most recently created item.
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Chieng Kai Seng (08-12-2011)
  #26  
Old 08-12-2011
Chieng Kai Seng Chieng Kai Seng is offline
Flexsim User
 
Join Date: Jul 2011
Location: Malaysia
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 109
Chieng Kai Seng is on a distinguished road
Default

I thought that IS standard functionality. haha! Okay. Thanks a lot for the input.


Thread Thread Starter Forum Replies Last Post
Sending GUI number to Global Table Albert Munoz Q&A 2 10-18-2010 10:59 AM
Sending messages to Flexsim cedric molthoff Q&A 2 03-10-2010 09:48 AM
Question on sending to different ports Jamie Santa Ana Container Terminal (CT) Library 2 09-09-2009 02:54 PM
Customizing Flowitem Attributes - a quest for the flowitem with the fewest attributes Cliff King Tips and Tricks 0 11-22-2007 12:22 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.