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 |
#1
|
|||
|
|||
Close A Specific Port
Is there any way to close or open a specific ports in Flexsim rather than all input or all output ports? Here's the problem: I have a model with 3 conveyors. Conveyor A feeds conveyor B in normal operating circumstances (through port 1). Conveyor B detects when it is backed up and changes the value of a global variable from 1 to 2. Conveyor A checks the value of the global variable in order to determine which port it will send flow items to (this is handled by a simple code in the Flow tab of conveyor A). When conveyor B backs up conveyor A sends the flow items to conveyor C (through port 2). Conveyor C acts as accumulation between A and B. When conveyor B is no longer backed up, the flow items will go from conveyor C to conveyor B. All flow items coming from conveyor A are stopped from going to conveyor B until conveyor C is cleared. This works fine for a small amount of items but the problem with this is it creates a lot of overhead for the model since every time a flow item reaches the output ports of conveyor A, the code for checking the global variable gets executed. As the model has grown this logic is starting to negatively impact its performance. I would like to be able to close and open individual output ports on conveyor A so that code only gets executed when conveyor B backs up or gets unbacked-up. Any alternative suggestions for handling this situation would be greatly appreciated.
|
#2
|
||||
|
||||
You don't need to open and close specific ports. In your Send To Port, you just need to return the port which leads to Conveyor B explicitly if B and C are blocked, and ConveyorB's input ports should be Conveyor C before Conveyor A.
The attached model is similar to what you are saying, doesn't use any open and closing of any ports, and doesn't use any global variables. All it uses is the send to port. (And there is a downstream conveyor with a message loop that closes and opens itself to show blocked and unblocked system states.) The catch with this sample model is that Conveyor A needs to be slightly slower than Conveyor B so that when it is running regularly, it doesn't accidentally send one to Conveyor C because of the slight timing of when Conveyor B becomes ready to receive the next item. But if you follow my original instructions with whatever you are doing to solve the problem, this little catch shouldn't be an issue. Hopefully this helps somehow. |
Thread | Thread Starter | Forum | Replies | Last Post |
is there a command which will return the port no. of a connected object? | KelvinHo | Q&A | 6 | 04-22-2010 02:13 AM |
set the location of flowitem from 2nd input port in a combiner | KelvinHo | Q&A | 4 | 04-11-2008 11:34 AM |