LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem setting sampling rate

I made the modification to the Export Waveform to Spreadsheet.vi, but the time string is starting back over at 0 after n=20 iterations or fewer. (I checked this by wiring an indicator to the i in the subVI). I'm attaching an image so you can see how I've modified the sub VI. Not sure if I've wired it wrong or if it's because I'm using 8.2?

I'm also attaching some example data so you can see what I mean.

Thanks!

Michelle

0 Kudos
Message 11 of 12
(415 Views)
Michelle,

The time string appears to be resetting because you are calling the Export Waveform to Spreadsheet File in a loop. In each iteration of the loop, the VI writes the samples that it has read from the DAQmx Read to the file. The loop that you have added to the Export Waveform to Spreadsheet VI takes an initial value of zero and adds the dt increment. Since you are calling the VI multiple times and the initial value is zero, the time value is reset. Running the VI in Highlight Execution mode (the light bulb on the block diagram) may better help you visualize this.

There are two possible fixes to this.

1) You could wire the t0 value to the shift register rather than a constant 0.

2) You could create an input control for the initial time value and a corresponding time output value in the Export Waveform to Spreadsheet File VI. You would then pass this value using shift registers in the loop of your main program. This would effectively save the time value from the previous iteration of the loop.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 12 of 12
(386 Views)