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
|
|||
|
|||
GlobalVariables & Processing Time
I want to use global variable to calculate processing time. The variable i have defined in global variable is Proctime, double in type.
Now i am trying to access it in processor process time script through getvarnum(model,"Proctime") above command is giving value zero, little bit clueless how should i access it. Attaching model for reference. |
#2
|
|||
|
|||
If it's a global variable, you just write the name in the script/template/trigger. getvarnum is just for retrieving values of nodes in the variables part of the tree.
If you want to test your code just write the expression in the "script window" (button on the Flexsim 'ribbon') and press Execute to see what it returns. |
#3
|
|||
|
|||
Thanks a lot
When i am printing global variable in this case Proctime to output console through pf(Proctime); it print 0.00000 that's the main reason i have not used it earlier. Infact system does work with using global variable name directly. In my case i am controlling global variable value through gui, strange thing whatever new value i give get modified (get in the operations) in the system in the second run not in the first run, although value of global variable changes immediately. Look forward to your reply |
#4
|
||||
|
||||
In the model you posted earlier the "pf(Proctime);" comand prints a 80.0000 to the Output Console. And this value don´t changes.
Tried to change your value by using "Proctime++;" and got no problems at all. Maybe you want to post the actual model once more!? For your other questions, without seeing the actual model, I only can give you the hint, that I often got problems while testing different ways in models with old code. Sometimes there happen strange things because of don´t deeply erasing all old testcode. Sorry that I can´t spend you more help.
__________________
Hemmi |
Tags |
globalvariables |
Thread | Thread Starter | Forum | Replies | Last Post |
Custom GUI processing time input & script control | shashanktrivedi | Q&A | 2 | 05-19-2011 10:28 AM |
how could I get opeartors move during processing? | zoeygollum | Q&A | 4 | 07-17-2010 01:06 AM |
Setup/processing order problems | Derrick Serbonich | Q&A | 2 | 07-09-2009 01:27 AM |
Robot processing | Sung Kim | Q&A | 7 | 08-27-2008 06:48 AM |
Using a Variable number of Operators for Processing | Brandon Peterson | Tips and Tricks | 4 | 07-16-2008 09:16 AM |