question

Eduardo avatar image
0 Likes"
Eduardo asked Felix Möhlmann commented

How can I end a function before it happens?

I am looking to restart the uptime after creating a timetable, aiming to acquire a new sample. Specifically, I'm simulating the replacement of a machine component during scheduled maintenance. I'm unsure how to proceed with this. Any assistance you can provide would be greatly appreciated.

Attached is the desired simulation in an image.

maquinas-excel-23-04-2024-8-27-30-p-m.png


FlexSim 23.2.1
customcodemtbf mttr timetablemantenance
5 |100000

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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

You could in theory remove the pending breakdown event from the event list. But I don't know if, and if so how, it would be possible to 'restart' the MTBF.

Instead I's suggest to use a Tracked Variable label to build custom logic that replaces the default MTBF/MTTR.

In the attached model, an Object Process Flow listens for state changes of the processor. While it is processing, it sets the rate of the TR to 1 (you can of course customize in which states the TR counts up). A different source reacts to the TR reaching a certain threshold and causes a breakdown when this occurs.

The down and up function of the maintenance time table reset the rate and value of the TR back to 0 respectively, so the 'timer' starts over.

DIY-MTBFMTTR-fm.fsm


diy-mtbfmttr-fm.fsm (38.7 KiB)
· 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.

Eduardo avatar image Eduardo commented ·

@Felix Möhlmann , thank you very much for helping me with the model. I have two questions.

1. Can I make the label behave like a statistical distribution and reset it to get a sample for the breakdown?

2. Can I add the on break down and repair options to the process flow since I use them to perform calculations in the simulation. I don't have much knowledge with process flow, it is really very useful.

flexsim-2023-update-2-diy-mtbfmttr-fm-1fsm-27-04-2.png

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Eduardo commented ·

1. To use a statistical distibution, use a Wait for Event instead of an Event-Triggered Source. You can then determine a new threshold every time before the token enters the activity.

In the Time Table function you can use code to move the token to the needed activity to re-evaluate the up time.

2. You can generally write any code you want in a Custom Code activity in Process Flow. The only thing you need to be aware of is that you might need to provide certain references/variables that are part of the header in the On Break Down/On Repair fields. Likely the only one you'd need is the object that is breaking down/being repaired. In the MTBF/MTTR this is accessible as involved. Since we're using an Object Process Flow, you can access it there as current.

diy-mtbfmttr-fm-2.fsm

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

Use a unique ID for each call of a stop. Then you can preempt this by a resume. Later if the regular resume call occurs, it does nothing, because it doesn`t find anything to resume anymore.

5 |100000

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