PDA

View Full Version : Recorder automatic export


Stephanie Giovannini
03-13-2008, 03:10 PM
I'm not sure if this is the right forum but nothing else seemed to fit...

The model has a number of recorders with user-defined tables. I want the results of each replication to be dumped into csv files at the end of each replication, without the manual process of double-clicking the recorder, choosing View Captured Data and Export.

I don't know which command would do this. I'm guessing exporttable, but I can't find the "table" that the recorder is actually using. I wrote the following, which compiles and runs at the end of replication but does nothing:

exporttable(node("Recorder1", model()), "C:\Proj\recorder1.csv");

What should I be looking at? What command might actually do this?

Alex Christensen
03-13-2008, 03:45 PM
You were very close. This command should work:

exporttable(node("/Recorder1>variables/graphdata",model()),"C:\Proj\recorder1.csv");

The node parameter of the exporttable function has to be the table node, not the object. The table is one of the variables, so it is under variables in the tree.

Stephanie Giovannini
03-19-2008, 01:14 PM
No, it didn't work. Still does nothing. I'm using version 3.5, does that matter?

Phil BoBo
03-19-2008, 04:52 PM
Try this:

exporttable(node("/Recorder1>variables/graphdata/1",model()),"C:\\Proj\\recorder1.csv",1,0);

First, the table node itself is actually a subnode of the graphdata node, one for each node recorded by the Recorder, so the node() command needs a /# where # is the row in the table of nodes recorded by the recorder.

Second, the string path in quotes needs \\ instead of \ because '\' is a reserved character in Flexscript and C++.

-Phil