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 |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
|||
|
|||
Accessing Data of a Recorder and Referencing Nodes in the Tree
Hello everyone!
My name is Jan Brandau an I am currently working on my master thesis with the help of Flexsim. I now like to access a certain node/variable of a recorder. I want to export the "AvgValue" to my custom statistics and therefore want it access this value. The parameter is highligthed in the picture. My question now is, if this is possible and how it is done. What I am able to do is to access the variable "histomax" for example, but I could not use the functions "getvarnode" or "getnodenum" on my problem. In this case they only return zero. I hope anyone can help me, Best regards, Jan Brandau |
#2
|
|||
|
|||
Hi Jan,
I dont know if i understand your problem right, but i think you did a wrong use of the command. What i mean: To access a node in the tree you can use the ranks or the names ie. Code:
getnodenum(node(">variables/maxspeed",current)); ( MAIN:/project/model...). Cause of the structure of the tree its possible to take the rank command to combine it with your getnodenum.. Code:
getnodenum(rank(first(node(">variables/graphdata",centerobject(current,1))),5); - node("variables/graphdata",..) = reference to the graphdata node - first(..) = reference to the first node in the graphdatanode (MAIN:/project/model...) - rank(first(..),5) = reference to the 5. node in the first node This is the code out of the samplemodel where it is implemented in the Textdisplay of the Visualtool. I hope you understand what i mean, its maybe not the best solution, but it works. I also have build up a short samplemodel for showing the Value. Wish you good luck with your work. Best regards Tobias Last edited by tobias.biemueller; 04-22-2008 at 05:39 AM. Reason: structure and layout |
The Following 2 Users Say Thank You to tobias.biemueller For This Useful Post: | ||
Martijn van Oostenbrugge (04-22-2008) |
#3
|
||||
|
||||
Nice support Tobias. For Jan's understanding. The getvarnode function can also be used instead of
node("variables/graphdata",..). Martijn |
The Following User Says Thank You to Martijn van Oostenbrugge For This Useful Post: | ||
Cliff King (04-22-2008) |
#4
|
|||
|
|||
Thanks a lot, that was quick and helpful, exactly what I needed.
I think I should pay more attention to that "rank" command and the Tree Access commands in general. That might be useful, especially as I have many nodes that need to be accessed and searched. So, thank your very much! Jan |
#5
|
||||
|
||||
If you are using the node command you can also use the ranknumbers in stead of the names. So in case of :
getnodenum(rank(first(node(">variables/graphdata",centerobject(current,1))),5); you can also enter: getnodenum(node(">variables/graphdata/1/5",centerobject(current,1))); Steven |
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post: | ||
tobias.biemueller (04-23-2008) |
#6
|
|||
|
|||
That's even better, looks quite elegant now an fits into the rest of my program.
Code:
int i = 42 while(i>0) {treenode recorder = node("/Recorder",model()); double number = getnodenum(node(concat(">variables/graphdata/",numtostring(i,0,0),"/5"),recorder)); settablenum("DLZ",gettablerows("DLZ"),6,number); i --;} Thank you! |
Thread | Thread Starter | Forum | Replies | Last Post |
The nodes in active view tree don't have unique names. | Tom David | Gripes and Goodies | 7 | 01-31-2013 07:01 AM |
Find all nodes toggled as C++ | Brandon Peterson | Tips and Tricks | 0 | 04-18-2008 03:36 PM |
Access to the tree variables | Iulian Marin Ion | Q&A | 2 | 02-06-2008 09:15 AM |