question

ernesto daniel AG avatar image
1 Like"
ernesto daniel AG asked ernesto daniel AG commented

how to pull variables from a statistic collector to another one?

Hello everyone I have a problem with a statistic collector

I made two codes in a statistic collector for a pie chart, a code for each one in both codes I declare similar things, then I have to repeat the same code twice

Is there a way to pull the or some variables that you declared in another code from another statistic collector?

I mean pulling variables from one statistic collector to another so as not to repeat the same thing in different codes.

I hope you can help me with that problem

Thank you

I share my model

I would like the factors, "quality" "performance" and "availability", to be accommodated in the pie chart "OEE" as it is in the model but without repeating the code of the three statistic collectors of each factor in the "OEE"

oee-model.fsm

FlexSim 18.1.2
statistics collectorcode
oee-model.fsm (22.3 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.

1 Answer

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered ernesto daniel AG commented

You can actually combine all the Statistics Collectors you have into a single Statistics Collector, with the four columns (quality, performance, availability, and OEE). When a Statistics Collector updates, it evaluates columns from left to right in the table, for each row. The internal object "data" is not reset between columns, so you can assign values to data in one column, and use it in the next column:

For the Quality column, you can use something like this in the Value code:

double quality;
// ... calculate quality
data.quality = quality;
return quality;

The same is true for the Performance and Availability columns:

double performance;
// ... calculate performance
data.performance = performance;
return performance;
double availability;
// ... calculate availability
data.performance = availability;
return availability;

Then you can use this code in your OEE column:

data.quality * data.performance * data.availability

Again, this only works if all four columns are always columns. Here is a demo model I made a while back that uses this technique:

oeedemo.fsm


oeedemo.fsm (24.4 KiB)
· 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.

ernesto daniel AG avatar image ernesto daniel AG commented ·

Thank you so much

your answer it was very useful

that's exactly what I was looking for

0 Likes 0 ·