LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert samples number to time and store it to TDMS file in FPGA code

Hello,

I am using a cRIO-9039 with Module  NI 9232.

I wrote a simple FPGA code in order to acquire a voltage signal from an eddy current sensor in function of time and store data in a TDMS file. The TDMS file has one column with the Voltage values output at each time step. What I am trying to get is second column that has a time value corresponding to each sample number in such away the time column will start from 0s to T (T is the duration of test corresponding to the last sample number). 

 

Second thing, I would like to display on my front window the sampling rate of the acquiring data and also the sampling rate used to write the data in the Waveform chart so I can have more understanding of the whole model since I am still beginner in LabVIEW coding.

 

I am attaching the project, FPGA and RT files. I will be grateful for any help.

 

Kind regards,

Nidhal

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

Hi Nidhalj,

 

I am attaching the project, FPGA and RT files.

It would really help to get the whole project including the lvproj file.

Just ZIP the folder containing lvproj and VIs…

 

What I am trying to get is second column that has a time value corresponding to each sample number in such away the time column will start from 0s to T (T is the duration of test corresponding to the last sample number). 

t := i * dt

dt is the sampling period, i is a sample counter starting from zero.

Create a 1D array from this calculation, BuildArray with your FIFO data…

 

I would like to display on my front window the sampling rate of the acquiring data

You set that "sampling period" control in your VI. Sampling rate is the reciprocal of that value…

 

Why do you reshape your FIFO data from 1D array to a 2D array with just one row? Why not just use BuildArray?

Why don't you create a waveform from your FIFO data (using the correct dt value)?

Why does your channel name array contain 4 channel names while you only read one channel in the FPGA?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,967 Views)

Hi GerdW,

 

Thank you for your valuable help!

 

It would really help to get the whole project including the lvproj file.

Just ZIP the folder containing lvproj and VIs…

Please find attached the zip file. 

 

dt is the sampling period, i is a sample counter starting from zero.

Create a 1D array from this calculation, BuildArray with your FIFO data…

I tried to follow your instructions to create a 1D array from t= i * dt. Please take a look at the RT file and see if what I did is right. But I didn't know to what connect the output of the 1D array?

 

You set that "sampling period" control in your VI. Sampling rate is the reciprocal of that value.

Is what I did is right?

 

Why do you reshape your FIFO data from 1D array to a 2D array with just one row? Why not just use BuildArray? 

Because I have started from an example I found it about acquiring data from 4 accelerometers, and in my case I will need this code to acquire data from 2 or 3 different sensors in the future, but at the moment I started with only one sensor to make the whole code simpler form me to understand it.

 

Why don't you create a waveform from your FIFO data (using the correct dt value)?

How can I do that?

 

Why does your channel name array contain 4 channel names while you only read one channel in the FPGA?

Sorry but I don't see where the 4 channel names are?

 

Kind regards,

Nidhal

 

 

 

 

0 Kudos
Message 3 of 3
(1,953 Views)