question

Sandrine R avatar image
0 Likes"
Sandrine R asked Joerg Vogel answered

Convert unit of source shape

Hello,

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?

Thank you!

FlexSim 21.1.2
model unitsconvert
5 |100000

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

Clair A avatar image
2 Likes"
Clair A answered Clair A converted comment to answer

Hello Sandrine,

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:

  • when a box enters the queue, we want to increment the tracked variable TotalWeight
  • when a box exits the queue, we want to decrement the 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.


· 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.

Sandrine R avatar image Sandrine R commented ·

Thanks a lot for your help !!

0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

@Sandrine R

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.

List("itemListQueue").stats.fieldTotal("mass").value

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.

totalLabelValues.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.

Sandrine R avatar image Sandrine R commented ·

Thanks a lot for your help !!

0 Likes 0 ·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Sandrine R commented

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.

FS_21_1_2_Track_Label_Sum_Example.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.

Sandrine R avatar image Sandrine R commented ·

Thanks a lot for your help !

0 Likes 0 ·