LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculations on data from TDMS

Solved!
Go to solution

Hello

I've made a program that can store data from a cRIO through FIFO at speeds up to 50k HZ'S and storing the data on in TDMS  file on my host computer. The data is coming from two NI 9237 strain modules with a total of 8 inputs. Due to performance issues I can't convert the RAW data to force and store it. Instead I store the RAW data in TDMS, and have a low priority force calculation to give me an indication of the current forces while in RT.

After the data gathering I want to perform the force conversion on the stored data in my TDMS file. The data is gather on the FPGA in the following way(see fpga.png): data is sent to build array and then passed into the FIFO.
On the host, the array is sent from the FIFO to decimate->build array->TDMS file with group name "RAW data", and with 8 channels. As another group on the TDMS file, I store the force displayed while in RT.

What is the best way to do the programming for reading from the TDMS file and converting the data to forces? I have tried using TDMS open->TDMS list content->TDMS read this gives me an waveform output. At this point I'm not sure how to proceed. How can I split the waveform into channel 1-8 so I can perform the conversions with my sub VI's? Or have I done something wrong since I get the waveform output from the TDMS read? I want to read group "RAW data" and channel 1-8 from the file. 


Regards.
Christian

 

Download All
0 Kudos
Message 1 of 8
(3,712 Views)

When you read from the group, you should get an array of waveforms.  You can then index which waveform you want.  To get to the data, you need to unbundle the Y component out of the waveform.  You can then do whatever calculations you want on the data.  If you are doing the same thing to all of the waveforms, just use a FOR loop with autoindexing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(3,699 Views)

Thank you for your quick respons crossrulz.
Just to clearify: data->Index array->Get waveforms components->Index array. My problem with autoindexing is that the data needs to be calculated in 4 different ways, I suppose a stacked sequence might do the trick? Or it might slow down the speed of my program?

0 Kudos
Message 3 of 8
(3,690 Views)

@cdonc wrote:

Thank you for your quick respons crossrulz.
Just to clearify: data->Index array->Get waveforms components->Index array. My problem with autoindexing is that the data needs to be calculated in 4 different ways, I suppose a stacked sequence might do the trick? Or it might slow down the speed of my program?


A more clear, and generally considered "better" way is to create a subVI for each calculation type and call each one of them in succession. But, I don't necessarily know what your "calculations" are so there may even be a better way than this. Can you provide more detail?

0 Kudos
Message 4 of 8
(3,679 Views)

Or you can wire a 2D array of double to the "data type" terminal of TDMS Read. The data read out should have 2 dimension as well and you can index the 2D array to get the channel data.

Message 5 of 8
(3,652 Views)

for(imstuck): I'm trying to convert ratiometric data to forces in Newton. Do you see a clever way of performing the convertion? I have included the sub VI in the ZIP file. 


deppSU: Thank you for your reply, I have enclosed the project including the TDMS file with the data on. In this project I have tried to read and calculate the "z akse"channel from the "RAW data" group. The problem is that I only get 1 constant force value in my new file. Have I wired something wrong?

I had some problems using the waveform and get component, I'm not shure if it's better to work with an array or waveform in my project.

0 Kudos
Message 6 of 8
(3,636 Views)
Solution
Accepted by topic author cdonc

I was imagining something more like this for your analysis.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(3,622 Views)

Thank you, that worked very well. I modified it so that I could handle each channel indivually with regards to different calculations needed.

Thank you so much again 🙂

0 Kudos
Message 8 of 8
(3,609 Views)