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 05-22-2008
KelvinHo KelvinHo is offline
Flexsim User
 
Join Date: Jan 2008
Location: Hong Kong
Posts: 129
Downloads: 18
Uploads: 1
Thanks: 44
Thanked 23 Times in 7 Posts
Rep Power: 166
KelvinHo will become famous soon enough
Default is there a command which will return the port no. of a connected object?

as title.

the case is: A's output port is connected to B & C in parallel, at which in same cases B & C will send msg to A, then I would like a command to point out the output port no. of the msgsendingobject.

Thanks,
Kelvin
Reply With Quote
  #2  
Old 05-23-2008
Lolke Koopmans's Avatar
Lolke Koopmans Lolke Koopmans is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Posts: 42
Downloads: 21
Uploads: 0
Thanks: 24
Thanked 14 Times in 10 Posts
Rep Power: 158
Lolke Koopmans is on a distinguished road
Default

Hi Kelvin.

You could use ipopno. This will return the output port of your object A.
Assume A is connected to the input port 1 of B and input port 1 of C, then your statement would look like: int port = ipopno ( msgsendingobject, 1 );

Regards,
Lolke
Reply With Quote
The Following User Says Thank You to Lolke Koopmans For This Useful Post:
KelvinHo (05-28-2008)
  #3  
Old 05-23-2008
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: 485
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

Kelvin,

You can also use "opipno" for the reverse of your situation and "cpcpno" for when you want to know about center ports.

Good Luck,
Brandon
__________________
thats not normal.
Reply With Quote
  #4  
Old 05-28-2008
KelvinHo KelvinHo is offline
Flexsim User
 
Join Date: Jan 2008
Location: Hong Kong
Posts: 129
Downloads: 18
Uploads: 1
Thanks: 44
Thanked 23 Times in 7 Posts
Rep Power: 166
KelvinHo will become famous soon enough
Default

Thanks, problem solved with ipopno
Reply With Quote
  #5  
Old 04-21-2010
Sung Kim Sung Kim is offline
Flexsim User
 
Join Date: Jan 2008
Location: York, PA
Posts: 85
Downloads: 70
Uploads: 0
Thanks: 70
Thanked 9 Times in 6 Posts
Rep Power: 155
Sung Kim is on a distinguished road
Default swap port rank during run

Hi,
It is nice to know the usage of "ipopno/opipno" commands. Thanks to you all, it also helped my logic approach. By the way, is there a command to swap the port connection ranks?
I understand that we can do it before model runs as you guys suggested, but I would like to swap/re-order the connection rank while the model runs based upon a certain condition (basically inside a trigger logic). I tried to take away from the logic found in "View" tree of "Rank up/down" button in General tab, but hard to understand the codes.
I thought about "setrank" command, but it seems awkward because the connected objects are not contents of each other(??).

Any advice or examples will be appreciated!
Thanks
Reply With Quote
  #6  
Old 04-22-2010
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: 374
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

Hi,

you can coordinate your material flow in the properties window of each object. Take a look at the "flow" tab. In the "send to port" fields are a lot of ready to use options or you create your own logic.

Another way could be to close and open ports (closeinput, openinput etc.). You can combine this with senddelayedmessage.

Greetings,

Carsten
Reply With Quote
  #7  
Old 04-22-2010
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: 679
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,

It is quite easy to change the order of ports and you where on the right track. If you look in the tree of an object you find the subnode "connections" and there are the port connection that an object has.
The following line of code will make the last output connection the first one:

setrank( last( connectionsout( current) ), 1);
Reply With Quote
The Following 3 Users Say Thank You to Steven Hamoen For This Useful Post:
Lars-Olof Leven (04-22-2010), Phil BoBo (04-22-2010), Sung Kim (04-22-2010)
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
return 1 in entry trigger? qin tian Q&A 1 05-07-2008 04:05 PM
set the location of flowitem from 2nd input port in a combiner KelvinHo Q&A 4 04-11-2008 11:34 AM
Command getnextnetnodeoutport Martijn van Oostenbrugge Q&A 0 02-22-2008 05:42 AM
releaseitem command AlanZhang Q&A 3 10-04-2007 10:11 AM


All times are GMT -6. The time now is 10:52 PM.


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