cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

One button that functions as a toggle between Run and Stop

One button that functions as a toggle between Run and Stop

Avoid having to move the mouse cursor between the Run and Stop buttons.

3 Comments

This is not doable. Once a model is stopped any other action from a dashboard is not evaluated any more, because the model is not runnung.

A Stop suspends any code execution from the model. An external action is needed to resume a model run.

Try it with code snippet

applicationcommand("run")

to get a model run by hitting a dashboard button.

Here is an code example for a dashboard button. Edit mode must be deactivated to fulfill action.

treenode link = node("..>objectfocus+", c);
runstop++; // increment a global variable or any other available label, node value or a table cell,..
if (runstop%2) /* modulus operator to get values of 0 as false or 1 as true*/
applicationcommand("run"); //true evaluated as run
else applicationcommand("stop"); // false as stop

runstop is a global variable in this code. Start value is set to 0.

toggle_run_stop_dashboard_button.fsm

You can use CTRL+Space to do this without using the mouse:

Image.png

hong_seongweon
Enthusiast

Thank you very much for the help

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea