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-24-2011
juan alberto juan alberto is offline
Flexsim User
 
Join Date: May 2009
Location: Valencia, Spain
Posts: 74
Downloads: 14
Uploads: 0
Thanks: 19
Thanked 3 Times in 2 Posts
Rep Power: 138
juan alberto is on a distinguished road
Default Dinamic Global Variables

Hello People!!
I have done a model in flexsim that generate global variables by flexscript code. The code create them with their initial values and in the window GlobalVariables, you can see the variables that the code generated with their values.
But when I want to use the value of that global variables, it is always 0, even I use refreshglobalvariables().

Can you help me with this problem?

Thank you!
  #2  
Old 05-24-2011
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

The answer to your question may be in this thread: http://www.flexsim.com/community/for...p?t=729&p=3236

If not, post your model so we can see what you are doing.
  #3  
Old 05-25-2011
juan alberto juan alberto is offline
Flexsim User
 
Join Date: May 2009
Location: Valencia, Spain
Posts: 74
Downloads: 14
Uploads: 0
Thanks: 19
Thanked 3 Times in 2 Posts
Rep Power: 138
juan alberto is on a distinguished road
Default Dynamic Global Variables

Hello Phil!

I've added the model where I want to add a global variable with a user command. In this user command I have to add all necessary nodes for a global variable.
In a script I call the user command, refresh the global variables and then I see the current value of the global variable and the value of the node Data in the global variable that I've been added. This value is different and I don't understand, why?
If you knows it, please tell me why.

Thanks in advance.
Attached Files
File Type: zip exampleAddGlobalVariable.zip (17.5 KB, 145 views)
  #4  
Old 05-25-2011
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

The type is the position in the pulldown of the global variable GUI, and the data has to be string.

Also, your test script probably won't work as the variable doesn't exist when the flexscript is built.
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post:
Sung Kim (09-26-2014)


Thread Thread Starter Forum Replies Last Post
Global variables juan alberto Q&A 5 11-10-2010 05:47 PM
Global variables to control state of a machine m matias Q&A 5 03-18-2010 06:20 PM
Update of global variables BenjaminBuecklein Q&A 4 11-18-2008 03:43 AM
Limit in the completion hints? Global Tables, Global Variables, etc.? Tom David Gripes and Goodies 6 09-09-2008 04:05 PM
State files and global variables Markus Bans Q&A 3 07-08-2008 12:22 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.