LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone tell me how my code is sampling and at what interval?

I'm new to LabVIEW but I am trying to make a VI that will read in a bunch of analog values and average them once every second, then record a this value in a spreadsheet.

 

Basically, I want a current and voltage reading every second.

 

Right now I cannot seem to wrap my head around how to determine the sampling interval of my VI it just seems like its all over the place. Can some but take a look a maybe give me a few help me understand the timing of my VI?

 

 

0 Kudos
Message 1 of 3
(2,293 Views)

You have configured your hardware to do continuous acquisition at 1kHz, according to the default settings on the front panel.  You may change these before you run your code.  Then, in the while loop, you wait for 10ms or 100 samples (the "Samples to Read" input) on each channel.  I'm not sure why you split the channels, then merge them again.  Finally you are writing to a file in a strange format: you have a 2D array, and you're putting a timestamp before only the first row of that array, so if you attempt to read that data into Excel and you expect the first column to be the timestamp you'll get weird results.  Is that the problem?  Otherwise I don't see how there's a question about timing since you are using the hardware clock.

0 Kudos
Message 2 of 3
(2,284 Views)

Take a look at this tutorial and this other one. I believe they can help you understand better your VI settings. I hope it helps

Alejandro C. | National Instruments
0 Kudos
Message 3 of 3
(2,255 Views)