I'm a beginner with Flexsim and I can't perform an operation.
Instead of tracking the number of pieces in my queue, I want to track the weight of the queue.
So, if I have 4 boxes in my queue (2 boxes of 3 kg and 2 of 4 kg), in the dashboards, instead of showing 4 boxes, I want to see 14 kg (= the total weight of my boxes).
Can you help me?
Answer by Clair A ·
There are multiple solutions to implement what you are looking for. As you are a beginner, I will try to share with you what I think is the easiest solution, without using advanced tools.
You can add a new tracked variable in your model:
Rename this variable for example TotalWeight and select the type of variable: Level.
Then pin this new tracked variable to a dashboard (in a new dashboard or an existing dashboard if you already have one) as a Line Chart:
Currently you just have an empty graph:
The next step is to update your tracked variable.
I assume that you defined a label on your flowitems for the weight.
In this example, let's assume that you created a label named Weight on all boxes:
And that when the source creates boxes, you update this value to whatever weight you want (using a schedule, or an On Creation trigger).
We need to update our tracked variable TotalWeight:
So in the properties of the Queue, add 2 triggers: On Entry and OnExit:
For both triggers, add the pickoption Set Tracked Variable:
In the On Entry trigger, select Increment, then pick your tracked variable and by how much it will be incremented:
The expression item.Weight means that it will read the value of the label Weight of the flowitem.
In the On Exit trigger, select Decrement, then pick your tracked variable and by how much it will be decremented:
Reset and Run your model, your chart will be updated:
I advice you to set a custom title, a Y axis title and you can also hide the legend if you want:
Please find attached a small example: 2021-05-03 Weight in queue versus time.fsm
Hope this helps.
Answer by Jörg Vogel ·
I have done this with a List.
I push and pull the items and the mass values to a list. In the example I do this in process flow, but On Entry and On Exit trigger works this, too.
I evaluate the total field list value with this code line.
Before I set the list to Track Number Field Totals in General tab properties.
In my attached model I set a label value at the queue by this code line and I use this line in the statistic collect another time. The label value is then the output in the dashboard as a Dynamic text field.
Answer by Felix Möhlmann ·
Hi @Sandrine R,
you could keep track of the total weight of boxes in a label on the queue, that gets updated every time a box enters or leaves the queue (On Entry and On Exit trigger). This value can then be tracked in a statistics collector and displayed in the dashboard.
I build a small example model to show the concept.