LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save analog output voltage and time stamp into array

Hello everyone,

 

I am new in labview. I am using NI Crio 9039 and labview 18. I want to perform filtering on Analog data. Can anyone let me know how to save data, both voltage and time stamp from analog channel in array. When i am trying, i am able to save only voltage and not time.

 

Please help me in understanding.

 

Thanks

0 Kudos
Message 1 of 9
(2,839 Views)

The problem is almost definitely in the code you didn't post.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 9
(2,811 Views)

Please find the VI, I am trying to design.

I tried 2 ways, one through for loop and flat sequence to give delay of 10 ms.

 

Other through timed loop. I could see only analog voltage values in arrays but not time stamping.

0 Kudos
Message 3 of 9
(2,791 Views)

In your second and third loops, you'll never see any data in those array indicators.

 

All your loops have a false wired to the stop terminal.  That means they'll run forever until you abort your VI.  The second loop will continually build the array in memory at the auto-indexing tunnel until you run out of memory.  The third loop will just maintain the last value in memory as a scalar, but never do anything with it either.

 

Your first loop will build a waveform of data, but it gets coerced to a single scalar value when you wire it to the analog output.

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

 

You said in the first message you want to take data from the analog input and build it in an array.  Put a shift register on your loop and a build array so it concatenates the new value you read to the end of the array.  Of course if you never clear out the array, you'll eventually run out of memory since your while loop never stops.

0 Kudos
Message 4 of 9
(2,778 Views)

Dear ravens,

 

Thank you for the reply. I got it.

 

I used for loop with which I could analog input in array but my concerned is how to store it with respect to time as I want to perform some signal conditioning on captured data.

 

In array I am able to see only analog voltage value.

0 Kudos
Message 5 of 9
(2,752 Views)

This is how you build a 2-D array of inside the loop that combines the timestamp with the analog input voltage that you read.

 

For course this creates an ever growing array that you will have to do something with before it exceeds your free memory.

 

0 Kudos
Message 6 of 9
(2,742 Views)

Dear raven,

 

I am still not getting expected result.

I want to store analog data with time stamp but I am getting same value.

 

I am not getting where i am getting wrong. As I mentioned, I want to store analog values with time.

 

I have attached the screenshot of result and VI as well.

Download All
0 Kudos
Message 7 of 9
(2,697 Views)

Hi Monica,

 


@Monica10975 wrote:

I am still not getting expected result.

I want to store analog data with time stamp but I am getting same value.


Why do you think so? In the screenshot the voltage values vary over time!

What about using a different numeric format to see the timestamp value with more digits? Something like "%.3f" would be fine…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(2,694 Views)

Ohh...Yes..I got it. I am getting results now. Thanks a lot😀

0 Kudos
Message 9 of 9
(2,689 Views)