ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 05-23-2012
Bill Lank Bill Lank is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 15
Downloads: 13
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 156
Bill Lank is on a distinguished road
Default Global Variable resetting

In ver 6 the behavior of global variables when resetmodel is called has been changes.

Previously the current value of the variable is unchanged (as stated in the command reference) but in ver 6 it seems that their values are being reset to a default.

Define a global variable TwoSided then run this script with a command window open to demonstrate this,

pr();pt("TwoSided Was = ");pf(TwoSided);

if (TwoSided)
TwoSided =
0;
else
TwoSided =
1;
 
 
pr();pt("TwoSided Is = ");pf(TwoSided);
resetmodel(0);
pr();pt("TwoSided Now = ");pf(TwoSided);

Thanks for the help

Bill
  #2  
Old 05-24-2012
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

That's correct. This was a specific request from several users. When the model resets, the values are set back to what the user defines in the Global Variables window.
  #3  
Old 05-24-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Note that you can still set the value in the model reset trigger (which you had to do previously to get the now default behaviour).

Consider using the new experimenter variables too as they are also global.
  #4  
Old 05-25-2012
Bill Lank Bill Lank is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 15
Downloads: 13
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 156
Bill Lank is on a distinguished road
Default

I guess I feel a rank coming on, this seems a little bit of a radical change in behavior. I've depended on global variables to set conditions that stay constant whenever I do a model reset, now I need to save these values some place every time their changed so that I can reset them to the expected values in the Model Rest Trigger, it seems to me that the former default behavior was much more intuitive.

Any way, can anyone suggest a simple solution for capturing the current global variable values so I won't need to modify my code extensively.


Thread Thread Starter Forum Replies Last Post
global variable in DLL (UserFuncs.h) Esther Bennett Q&A 7 09-12-2012 07:02 PM
Change Global Variable Permanently Chris Moon Q&A 3 04-11-2011 07:46 PM
Global variable & task sequence Chris Moon Q&A 1 03-02-2011 10:46 AM
Global variable as experiment variable Matthias Hofmann Q&A 3 09-08-2009 09:42 AM
Display Global Variable Sung Kim Q&A 4 02-24-2008 11:24 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.