LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog output sampling

I have code that applies voltage for a certain ammount of time, I am using a USB-6008 Analog output to read back the measured current, I want to record the measurment exactly every 1 second. I set the sampling freq to 1Hz but I am still getting more data than what I expect. for example when I am applying 60 seconds of voltage I expect to see 60 data point every second however I see more data.  

Capture2.PNG

0 Kudos
Message 1 of 8
(4,503 Views)

Uee a timed loop and do a single sample.  It will give you better results.

 

 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 8
(4,500 Views)

It looks like you are scanning multiple channels since your polymorphic instance of DAQmx Read is set for, "N Channels N Samples".  Are you getting more than 60 data points for each channel or the cumulative amount of samples is more that 60?  How many data points are you seeing?

Michael L.
Sales Engineer
National Instruments
0 Kudos
Message 3 of 8
(4,447 Views)

yes I am scanning multiple channles, and for each channel I receive 3 sets of 60 samples instead of one set.

0 Kudos
Message 4 of 8
(4,434 Views)

The way you have you program set up, each channel should only be collecting 60 samples.  I am wondering if the logging VI is arranging the collected waveform data in a weird way when you view it in Excel.  We should first see how many elements in the 1D array of voltage values LabVIEW is returning.  This can be done using the nodes in the VI I have attached.

Michael L.
Sales Engineer
National Instruments
0 Kudos
Message 5 of 8
(4,401 Views)

I used the timed loop and now it works, but I still wonder why it is giving me more than exepected data point when I use the sample clock.

0 Kudos
Message 6 of 8
(4,394 Views)

It shouldn't be outputting more than 60 values.  I tested this in a simple VI that is structured similar to your code with a simulated device and confirmed that only 60 samples were being written per channel (see attached).

Michael L.
Sales Engineer
National Instruments
0 Kudos
Message 7 of 8
(4,366 Views)

Capture.PNG

Is the likeliest cause.

 

That icon is "Export Waveforms to Spreadsheet File VI"

That vi does not have a string array output!  Someone's been playing inside VI.lib!

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(4,343 Views)