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
|
|||
|
|||
How to close ports of an object when a condition is true on another object?
Hi All,
I am working with fluid objects. In my model I am trying to close one of the output ports of a reservoir (Machine 1). When one of the tanks is full(Machine 2). I know I can use closeop() method in Machine 2 when it becomes full. But my problem is when I do that it gives me an error saying unknown Variable Machine 1. I have attached the code below. Any advice will be much appreciated. Code:
treenode current = ownerobject(c); int mode = parval(1); // 1 = rising, 2 = falling #define rising 1 #define falling 2 #define either mode { //************* PickOption Start *************\\ /**Open or Close Ports*/ /** \nFluid Mode: */ int curmode = /**/rising/**list:rising~falling~either*/; /** \nObject: */ treenode involved = /**/current/**/; if (mode == curmode) { /** \nAction: */ /**/closeinput(involved)/**closing reservoir port*/; closeop(Machine1, 1); /**closing output port at Machine 1*/ } /**\n\n*/ return 1; } //******* PickOption End *******\\ |
#2
|
|||
|
|||
You must first set up the treenode variable Machine1. The usual options are:
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Abdul Mirza (04-17-2013) |
Thread | Thread Starter | Forum | Replies | Last Post |
How to condition the opening/stoping of a conveyor port? | Ayoub EL BOUCHTILI | Flexsim Student Forum | 2 | 01-22-2013 02:30 PM |
Object as a subnode to another object.. | Nischith Kashyap | Q&A | 1 | 05-06-2011 01:12 AM |
RE: Change the rank of output ports of a object using flexscript | gadirajus | Q&A | 3 | 04-21-2011 02:44 PM |
send a flowitem from a mobile object to another mobile object | KelvinHo | Q&A | 5 | 03-03-2010 08:24 AM |
Transfer a mobile object by another mobile object | KelvinHo | Q&A | 7 | 07-17-2008 09:32 AM |