I create some triggers with the goal of repeat the test 3 times, when the test rest a trigger start the test, when the test stop, an global table is altered, and a specific cell thats start with 0 is incremented in 1, than if the value of this cell is lower than 3, the trigger calls the reset.
All this triggers are working when I manually push the equivalent button (e.g. when I push the button "stop", the test reset and automatically reset) this works for any button ("reset" and "stop"). However, if I start from any of the buttons, only the first trigger is active, and i can complete the loop as i want (e.g. when I push the button "reset", the test starts, goes to the end, stop and reset, but not start again).
I believe that is some configuration from Flexsim 18, created probable to avoid start an infinite loop. So, to do my test as I want, I need to disable (if there is the case) this lock.
I'm using Flexsim version 18.0.8 build 268 built on 06-Set-2018.
My code from the triggers:
//#################################################################// //#######################RESET TRIGGER#############################// //#################################################################// OnModelReset{ runspeed(1000); go(); } //#################################################################// //#######################STOP TRIGGER###############################// //#################################################################// OnRunStop{ //----------This first part is working fine------------------------// Variant tableID = /** \nTable: */ /***tag:table*//**/"execution"/**/; Variant row = /** \nRow: */ /***tag:row*//**/1/**/; Variant column = /** \nColumn: */ /***tag:col*//**/1/**/; Table table; switch (tableID.type) { case VAR_TYPE_NODE: table = tableID; break; case VAR_TYPE_STRING: table = Table(tableID.as(string)); break; default: table = reftable(tableID.as(int)); break; } Variant value = table[row][column]; value = value+1; table[row][column] = value; //-----------------------------------------------------------------// //the condition if also is working, just executing when the condition is true if(value < 3){reset();} }
I'm also tried use "User Commands" to call reset and start, trying to tricking the hypothesis of be an system look to avoid infinite looping, but was not an successful attempt.
I'm a C++ developer, and only recently start using Flexsim, so maybe that is a very simple question, but I'm already read many parts of user guild and looking for this solution on this forum, both without success. Even find some topics about loops, none of than was about this, and i won't use the Experiment tool to do so, once i'm intent to use a variable instead the fixed 3 for the time series, which i'm not seen how to do on experiment configurations, and I'll not need the features extractions from Experiment tool, this way I'm prefer don't use the Experiment tool for solve my problem, if possible, my main goal is use the "model" view as an exhibition tool for my project.
P.S. As suggested in an answer below, I'm annexing an example of my model with the triggers in the code above.