question

Parth avatar image
0 Likes"
Parth asked Parth commented

Source controlling

Hello,

I am new to FlexSim. I am trying to make a model in which my sources needs to be turned on and off from time to time. How can I develop this logic in FlexSim? I know the open and close port can be helpful or Stopping/resuming object but I'm not sure how to use them exactly. I would like to do this using some code (or any other way if easier). Below is the exact scenario I am trying to achieve.

With Source 1 and 2,

While source 1 is producing source 2 needs to be off. After certain time source 2 should start producing and source 1 needs to be off. And this cycle continues.

Thanks.

FlexSim 18.2.2
source control
· 1
5 |100000

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

tannerp avatar image tannerp commented ·

Do you know when the sources need to be on/off? If it's not randomized, you could use a scheduled source to achieve the behavior you are looking for.

If it is randomized, you could have "Custom Code" activities in Process Flow or, alternatively, triggers throughout your model that would close or open ports. Again, if these instances of Source 1 and Source 2 production are random, you can trigger a "Custom Code" activity in Process Flow by using a different source or listening activity.

Here's what the "Custom Code" window looks like. You can use the eyedropper next to the "Object" box to select the item you'd like to affect.

0 Likes 0 ·

1 Answer

·
Jeff Nordgren avatar image
2 Likes"
Jeff Nordgren answered Parth commented
@Parth

Attached is a sample model that will close the output port of Source1 and open the output port of Source2 every 100 time ;units. You can do this by using the User Events in the Toolbox. Would something like this work for your situation? It's simple and you could even add more User Events, if necessary.

Thanks.

source-control-jn1.fsm


· 1
5 |100000

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

Parth avatar image Parth commented ·

@Jeff Nordgren

Thanks for answering my question! I do think User Events can be helpful in my situation. Can they have formula in the input instead of just the times? I want source 1 to run for more percentage of time than source 2 but when source 2 starts its production I want it to complete its skus (flow items) before source 1 starts again.

So for example, if source 1 has 11 skus to run and source 2 has 4. I want source 1 to run for most of the time but when source 2 starts I want to complete all 4 skus (time independent) before it goes back to source 1. Is there any trigger or piece of code through which I can achieve this?

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.