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 |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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 |
The Following User Says Thank You to Lolke Koopmans For This Useful Post: | ||
KelvinHo (05-28-2008) |
#3
|
||||
|
||||
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. |
#5
|
|||
|
|||
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 |
#6
|
||||
|
||||
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 |
#7
|
||||
|
||||
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); |
The Following 3 Users Say Thank You to Steven Hamoen For This Useful Post: | ||
Sung Kim (04-22-2010) |
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 |