This 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.
This model simulates 3 types of a product that need to be counted.
Model Specific Implementation
Drag out a Source, Conveyor, Sink, and three Visual Tools.2.Open the Parameters window of the Source, click the Source Triggers tab, and add a function to the OnExit trigger using the Set Itemtype and Color option. The default blue text will work for this model
Open the Properties window of the Conveyor, and create three NumberLabels called it1, it2, and it3. Make sure to do these in the correct order (1, then 2, then 3).
Open the Conveyor’s Parameters window, click the Triggers tab, and add a function to the OnConveyEnd trigger using the IncrementValue option. Change the blue text to read as follows:
Add a function to the OnReset trigger of the Conveyor using the SetLabel option. Edit the blue text to read as follows:
Object: current
Label: “it1”
Value: 0
Repeat this step two times, using “it2,” and “it3.”
Open one of the Visual Tool’s Parameters window. Change the Visual Display to Text, then in the TextDisplay list, select DisplayLabelValue. Edit the blue text to read as follows:
Text: “Item 1: “
Object: centerobject(current,1)
Label: “it1”
Repeat this step for the other Visual Tools, except you will input Item 2 and it2, or Item 3 and it3 for the second and third Visual tools.
General Implementation
If you are going to count itemtypes, set the itemtype in the most convenient location for your model. This is usually done in the OnExit trigger of the Source, but could be different. If you are using labels to distinguish the types of products, create a label on the class of flowitem you will use in the Flowitem Bin.
Create a label on the object that will count the flowitems. Use as many labels as there are types of flowitems. To count the flowitems, the IncrementValue option works very well. Use the OnReset trigger to reset the counters whey you reset the model.
Configure Visual Tools to display the label value that you used to count the different flowitems. The DisplayLabelValue option on the Visual Tool works very well for this.