question

RICARDO PA avatar image
0 Likes"
RICARDO PA asked tannerp answered

Alternating items

Hi, I want a source that is able to create items alternately (batch of S, 60s later batch of E, 60s later batch of S and so on). So far I have created a counter on the source but I'm struggling to set the type/colour of the items conditional on the item number (or counter).

My idea is to have a counter that counts from 0-39 and then resets (which I'm struggling to do as well), and then be able to set items to S or E dependent of the number of the counter (0-19 to S and 20-39 E for example).

Can this be done? Cheers!

FlexSim 18.1.2
sourceconditionalsource control
· 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.

tannerp avatar image tannerp commented ·

Yes, this can be done. I made an example of this earlier this week, but unfortunately, it's in a newer FlexSim version. Give me a little bit and I'll produce one in 18.1.2.

0 Likes 0 ·
RICARDO PA avatar image RICARDO PA tannerp commented ·

Thank you very much! If its too much fuss I may be able to do with an explanation as well :)

1 Like 1 ·

1 Answer

tannerp avatar image
0 Likes"
tannerp answered

Please review this model and let me know if you'd like any further help or explanation. I wasn't sure if I met your parameters exactly, but hopefully this can get you started.

The code can be found under the "Triggers" in Source1. Essentially, it grabs the label on Source1 to determine the item's type and color upon creation. The label to count is incremented each creation. It looks like this:

Model: alternating-items.fsm


alt-items.png (35.4 KiB)
5 |100000

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