<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to open and close port based on object reference? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550106#M54961</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 I am looking for something through which we can find the 
 &lt;STRONG&gt;port number of Queue1 at Processor1&lt;/STRONG&gt; and control it.
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 17 Feb 2023 11:08:19 GMT</pubDate>
    <dc:creator>rajankur6494</dc:creator>
    <dc:date>2023-02-17T11:08:19Z</dc:date>
    <item>
      <title>How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550103#M54958</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.0.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi Team,&lt;/P&gt;
 &lt;P&gt;I am developing a model where I need to use object reference directly irrespective of port number to close or input the port between them.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;For eg: I would like to open/close the ports of "Processor1" and "Queue1" based on content condition in Queue1.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1676626264900.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1515397iC87048B5FE88A381/image-size/large?v=v2&amp;amp;px=999" role="button" title="1676626264900.png" alt="1676626264900.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Can you help me with it?&lt;/P&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 09:34:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550103#M54958</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2023-02-17T09:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550104#M54959</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You shouldn't open/close individual port connections, as those are controlled by the internal logic of the fixed resource and your command might be overridden.&lt;/P&gt;&lt;P&gt;To stop items from flowing in your example you would only close the (entire) input of Queue1. For that you only need a reference to Queue1 ("object.input.close()").&lt;/P&gt;&lt;P&gt;If Queue1 had multiple input connections and you only wanted to prevent items flowing through one, you could use intermediate queues with only one input each and close their input.&lt;/P&gt;&lt;P&gt;For completeness: You can get the port number which an object connects to on an upstream or downstream object with "ipopno()" and "opipno" (see command helper in FlexSim for further explanation)&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 10:07:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550104#M54959</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-02-17T10:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550105#M54960</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt;,&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;If Queue1 has multiple input ports, then using your approach may break the space constraint. What will you recommend in this case?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1676631907608.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1515393i35CB2405FDDCC68E/image-size/large?v=v2&amp;amp;px=999" role="button" title="1676631907608.png" alt="1676631907608.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 11:05:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550105#M54960</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2023-02-17T11:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550106#M54961</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 I am looking for something through which we can find the 
 &lt;STRONG&gt;port number of Queue1 at Processor1&lt;/STRONG&gt; and control it.
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 11:08:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550106#M54961</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2023-02-17T11:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550107#M54962</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Commands&lt;/P&gt;ipopno(..)&lt;P&gt;opipno(..)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 11:14:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550107#M54962</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2023-02-17T11:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550108#M54963</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/461/joerg.v.html" nodeid="461"&gt;@Joerg Vogel&lt;/A&gt;,&lt;/P&gt;
 &lt;P&gt;In this method, it is not serving the purpose I need.&lt;/P&gt;
 &lt;P&gt;I would like to know the port number at which Queue1 is connected to Processor without checking it manually. Since I have multiple cases in my model, I want to automate the process.&lt;/P&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 11:22:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550108#M54963</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2023-02-17T11:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550109#M54964</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/35485/ankura3.html" nodeid="35485"&gt;@Ankur A3,&lt;/A&gt; you have one set of information input port number and your current object:&lt;/P&gt;&lt;P&gt;The current.&lt;A href="https://docs.flexsim.com/en/23.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/Object.html#Property-inObjects"&gt;inObjects&lt;/A&gt; are an array in order of input port connections!&lt;/P&gt;&lt;P&gt;The output port number of your inobjects is the result of &lt;A href="https://docs.flexsim.com/en/23.0/Reference/CodingInFlexSim/CommandReference/Commands.html#ipopno"&gt;ipopno&lt;/A&gt;(current,input port number).&lt;/P&gt;&lt;P&gt;I do not understand what you mean by manually. You do this by code to gather this set of information.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 13:04:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550109#M54964</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2023-02-17T13:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550110#M54965</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Based on your example, why would simply limiting the content of the queues to 10 not work in this case? That would require no closing/opening whatsoever.&lt;/P&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;If you only have the object reference, then the only option is to loop through the connected objects and compare them to the target. See the user command in the attached model.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/64389-getportrank-fm.fsm" target="_blank"&gt;getportrank_fm.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 13:08:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550110#M54965</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-02-17T13:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550111#M54966</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;It might be simplest to create your own object using a BasicFR and control the ports yourself.&lt;/P&gt;&lt;P&gt;Or you could use the pull to determine if you are taking items from the upstream object as described below using a Map.&lt;/P&gt;&lt;P&gt;In the attached model at reset I create a Map label 'portMapIn' that is keyed on the input objects so that you can look up the port number quickly - this is a user command 'createPortMapIn'.&lt;/P&gt;&lt;P&gt;There are two other commands closeConnection() and openConnection() that take the receiver and send objects as parameters and update a portClosed label array on the receiver that is referenced by the pull.&lt;/P&gt;&lt;P&gt;If you run to the stop point in the model and step past it you'll see Queue2 received an item from Processor1. If you then repeat that but run the script to close the connection between those two, the transfer does not take place when you perform a step.  The transfer then takes place immediately when you open the connection.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/64395-portmapforreferencinginobjects.fsm" target="_blank"&gt;portMapforReferencingInobjects.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 14:49:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550111#M54966</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-02-17T14:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550112#M54967</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you so much! 
 &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; 
 &lt;P&gt;I was looking for exactly same.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2023 15:57:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550112#M54967</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2023-02-17T15:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to open and close port based on object reference?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550113#M54968</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/35485/ankura3.html" nodeid="35485"&gt;@Ankur A3&lt;/A&gt;, was one of Jason Lightfoot's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Feb 2023 18:17:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-open-and-close-port-based-on-object-reference/m-p/13550113#M54968</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2023-02-22T18:17:35Z</dc:date>
    </item>
  </channel>
</rss>

