ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Problem with resetmodel()
Hi,
when I try to reset a model (resetmodel()) in the On Run Stop trigger, Flexsim just quits. Can someone explain what I do wrong? Many thanks in advance! |
#2
|
||||
|
||||
The resetmodel() command may actually cause the OnRunStop to fire. So you call resetmodel(), which calls your OnRunStop, which calls resetmodel(), which calls your OnRunStop... until you get stack overflow and crash. Try doing instead:
if(time() > 0) resetmodel(); Although that may still not work. If not, try: if(time() > 0) { setnodenum(node("MAIN:/project/exec/time"), 0); resetmodel(); } |
The Following 2 Users Say Thank You to Anthony Johnson For This Useful Post: | ||
Jan Van Belle (12-22-2010) |