LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simulation loop write to file

I'd like to write to a spreadsheet the data from the two waveform charts in the attached VI. I've tried using the write to spreadsheet VI inside the loop but get prompted for a file name each iteration. When I put the VI outside the loop, all I get is the last value from the simulation. Is there anyway to simply store all the data from the simulation and then write the file after it is done?

 

Thanks,

Brian

0 Kudos
Message 1 of 4
(3,640 Views)

Hi Brian,

      I'm sure it's possible to write all the data at once at the end, though, perhaps it's enough to suppress the file-prompt?  The Excel Application has a "Display Alerts" property that can be set to False.  This assumes there's a default filename supplied to the "Save" or "Save As" method.

 

You can see an example that disables "Display Alerts" in the llb attached here.Smiley Happy 

 

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 4
(3,622 Views)

Brian,

 

To record the whole array, you can use the collector function (it is located at Control and Simulation>>Simulation>>Utility), get the output outside the simulation node, covert to array (using unbundle and build array) and use the Write to Spreadsheet file. To avoid the popup, just use a file name that is fixed.

 

Hope this helps!

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 4
(3,585 Views)
Thanks, Barp. Once again, it worked like a charm!
0 Kudos
Message 4 of 4
(3,574 Views)