02-12-2008 01:03 PM
02-13-2008 12:50 PM
02-13-2008 01:16 PM
I'm determining the sampling rate by applying a constant DC signal for 30 s followed by dropping the DC signal to ground. Based on the number of points I get for this 30 s before the signal goes to ground, I estimate that the sampling rate is ~260 Hz.
We have the PCI-6110 board.
Could you give me some more specifics about how I could use the Test Panels to determine whether the board or the programming is the cause of the problem?
02-14-2008 04:16 PM
02-15-2008 08:45 AM
I've tried a range of sampling rates from 100 Hz to 10 kHz. For rates <1 kHz, I get the error message described in my first post. For 1 kHz or more, I've been calculating the actual sampling rate using the data in from the "Write to Spreadsheet" vi, not the waveform graph. In the spreadsheet, I always get ~7740 points for the 30 s signal, regardless of whether the sampling rate I've set is 1 kHz, 5 kHz, or 10 kHz.
Perhaps LabView is sampling at the correct rate, but writing to the spreadsheet file more slowly. Is it possible to check/change this?
I opened the Test Panels and recorded some data, but I can't figure out how to get the actual sampling rate from the waveform graph. Is there a way to get this data in a chart so that I can see the number of points actually recorded?
Thanks again for your help,
02-18-2008 11:01 AM
02-20-2008 05:13 PM
It looks like that was the problem. I rewired the VI to use the Export Waveform to Spreadsheet VI and a waveform chart instead of the Write to Spreadsheet VI and the graph. It's now sampling correctly. For example, I've posted the results of a 100 Hz waveform sampled at 1 kHz.
Now I'm just having one small problem that's more of an annoyance than anything... The time data doesn't include any decimal points after the seconds place. I've tried changing this by opening the front panel for the Export Waveform to Spreadsheet VI and adjusting the format and precision of the time data, but it doesn't seem to change what's recorded in the file. I'm including a screen snap that shows how I've rewired the VI as well as the menu for the format and precision for the Export Waveform to Spreasheet VI so you can see what settings I've been changing.
If you or anyone else has any suggestions on how to get it to show some decimal points in the time readout, that'd be really convenient. If not, I can always generate the time column now that I know the VI is sampling at the correct rate.
Thanks for your help,
02-20-2008 06:13 PM
02-21-2008 01:00 PM
Thanks Dennis. We are using Version 8.2, and that worked very well.
OK, I think this is my last question... Within the Waveform Time to Date Time String SubVI or in another part of the VI, is it possible to have the absolute time (which is what is currently recorded) converted to a relative time (starting at t0 = 0.000 s and counting up).
Just trying to fine tune this now so that data processing will be faster. It's definitely working well as is.
Thanks again for all the help,
02-21-2008 02:00 PM - edited 02-21-2008 02:00 PM
Yes, you can do this as well. I normally just use the Write to Spreadsheet File but you can modify the Export Waveforms by doing somethinkg like is shown below. Instead of the functions Get Waveform Time Array and Waveform Time to Date Time String, this code will generate a series of relative times starting at 00:00:00. Note that this works on 8.5 and there may be some slight differences in the creation of the time string with your version. I don't have 8.2 so I can't test it. Also, since you are changing the functionality of the Export Waveform function, be sure to save it with a new name and in a new location.