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 02-25-2011
Hao Zhou's Avatar
Hao Zhou Hao Zhou is offline
Flexsim User
 
Join Date: Sep 2010
Location: Long Beach
Posts: 66
Downloads: 56
Uploads: 0
Thanks: 78
Thanked 43 Times in 25 Posts
Rep Power: 146
Hao Zhou will become famous soon enoughHao Zhou will become famous soon enough
Default How to send more than 3 parameters by senddelaymessage()

Is it possible to send more than 3 parameters by command senddelaymessage() or by other commands? How to do this?

Thank you very much for your help!
  #2  
Old 02-25-2011
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

Hi,

build a table, fill it with parameters, send the reference of the table.
tables can you build at many nodes. Try it with a label node.

Jörg
The Following 5 Users Say Thank You to Jörg Vogel For This Useful Post:
Sebastian Hemmann (02-28-2011)
  #3  
Old 03-02-2011
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Hao,

You might run into a problem with Jorg's solution if you send the message again before the first message's delay time expires. This will be caused because the label values will be written over before the first message reads them. You can get around this by creating a node somewhere (probably in a label) to store the table that Jorg suggested. Then send the tonum() value of the node you creaded as one of the message parameters. When the message fires you will want to delete the node after you have read the values out of the table (also want to clear out any nodes on reset). This way you will have a unique table for each delayed message.

Good Luck,
Brandon
__________________
thats not normal.
The Following 2 Users Say Thank You to Brandon Peterson For This Useful Post:
Jörg Vogel (03-03-2011)
  #4  
Old 03-02-2011
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: 773
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

My suggestion:

Create a label on the sender object - say 'tempParams'
For each call, place the parameters in a new row under tempParams (a cell in the row can also contain a table if needed)
Make the row node (last(label(current,"tempParams"))) the sender in senddelayedmessage (if your not using delays, then consider a usercommand or nodefunction instead)

When the message is received:
Find the true sender using ownerobject(msgsendingobject)
Refer to the parameters by get(rank(msgsendingobject,<n>)) for each parameter <n>
Use destroyobject(msgsendingobject) when you're finished to clean up.

This method will allow for state-saving the model.
The Following 4 Users Say Thank You to Jason Lightfoot For This Useful Post:
Steven Hamoen (03-02-2011)


Thread Thread Starter Forum Replies Last Post
runspeed with 2 parameters? Steven Hamoen Q&A 3 10-01-2010 11:33 AM
Passing parameters in executefsnode Sung Kim Q&A 2 06-01-2010 09:37 AM
Problem with Send to Output Port Joe Allen Q&A 3 05-14-2009 02:38 PM
Using Reevaluate Send To vs Pull Brandon Peterson Tips and Tricks 4 11-19-2008 08:56 AM
how to send msg to another which do not have connection with the sender object KelvinHo Q&A 3 03-05-2008 04:28 AM


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.