question

Javier Benitez avatar image
1 Like"
Javier Benitez asked Javier Benitez commented

How can I connect operators to output port from a table in a dispatcher?

I would like to connect in my dispatcher 2 different operators, choosing them from a global table.

FlexSim 18.1.0
output port
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matt Long avatar image Matt Long commented ·

Are you wanting to dynamic connect them at reset? or to change this during a model run? There are things the dispatcher does on reset to set up it its connections.It would be more advisable to connect all of your objects up, and then turn ports on and off to objects you're not using or change your pass to logic.

1 Like 1 ·
Javier Benitez avatar image Javier Benitez Matt Long commented ·

yeah I want to dynamic connect at reset, since my idea is to control the Operators Line up from an excel file, and I have stations with dispatchers, so my global table is reading from my excel file, and I would like that my dispatcher reads its output connections from the global table.

0 Likes 0 ·

1 Answer

·
Matt Long avatar image
1 Like"
Matt Long answered Javier Benitez commented

I've attached a simple model that uses the On Reset trigger of the dispatcher to set up connections to any of four operators. The data is read from the global table. Hopefully this helps.

dynamicdispatcherconnections.fsm


· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Javier Benitez avatar image Javier Benitez commented ·

Perfect! thats what I need, just, what can I do, in order for when I click on reset several times, it doesn't always add the ports?
It needs a clear output ports in there I believe.

Thanks in advance!

0 Likes 0 ·
Matt Long avatar image Matt Long Javier Benitez commented ·

Yes, good point. You could add a for loop before the one that creates connections and have it do a contextdragconnection() with the "Q" character on all of the objects. Then in your second loop you would only need to create the connections.

1 Like 1 ·
Javier Benitez avatar image Javier Benitez Matt Long commented ·

Alright, did what you told, that did the job, Thanks!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.