question

Wilfredo Salinas avatar image
1 Like"
Wilfredo Salinas asked Ben Wilson edited

Is it possible to manually cause a processor breakdown?

I am simulating a process that runs for hours and would like to be able to manually cause a breakdown if I see a portion of the process being too busy.

Is this possible? I have version 7.3.6

FlexSim (other - please specify)
FlexSim (other)
mtbf mttr
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

·
Brandon Peterson avatar image
2 Likes"
Brandon Peterson answered Ben Wilson edited

The most simple way to do what you want is to call the "stopobject()" command on the object when you want to break it down and "resumeobject()" when you want it to restart. You can execute the commands from a script window if you are just testing things out or you could make a GUI with breakdown and resume buttons that execute the code when pressed.

***If you already have breakdowns that occur on the machine then you will want to use the same method being used by the breakdown method if it is different than above.

· 4
5 |100000

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

Wilfredo Salinas avatar image Wilfredo Salinas commented ·

@Brandon Peterson

I received this error when testing your command

Flexscript Error VIEW:/active/MainPanel/BackPanel/SplitterXPane/SplitterYPane/ScriptConsole/Script>script line 2 unknown variable "Machine1"

Warning VIEW:/active/MainPanel/BackPanel/SplitterXPane/SplitterYPane/ScriptConsole/Script>script line 2 Too few parameters in call to stopobject

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Wilfredo Salinas commented ·

@Wilfredo Salinas, stopobject() takes at least 2 parameters (see documentation here).

The first parameter is a valid reference to your breakdown object. In your case, Machine1 is not a valid reference. There are many ways to get a reference to an object in your model, but from the script window you may want to use the node() command.

The 2nd parameter is the state you want the object to be in while it is stopped. STATE_BREAKDOWN is one example. These state macros all start with STATE_ and you can check the autocomplete as you type it in the script window for more examples of possible states.

So a usage example for calling stopobject() from the script window, if your processor is named "Machine1" and is at the root level of your model (not embedded inside some other container object):

stopobject(node("MODEL:/Machine1"), STATE_BREAKDOWN);
1 Like 1 ·
Cameron Pluim avatar image Cameron Pluim Ben Wilson ♦♦ commented ·
@Ben Wilson

Unfortunately with you're code you will also get a syntax error. You're missing a close parenthesis after the end quotation mark. ;)

2 Likes 2 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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