LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Logging and Organizing TDMS Files

Hello all,

 

I currently having a working project where my FPGA is taking samples from an ADC and timestamping them. The problem is, I only want one time reference but currently my program is taking a timestamp and adding it an array over and over ( its the same timestamp). I just need help or a code snippet of some sort array manipulation to help me sort the array into a format I want.

 

wsimpson0050_2-1752858648412.pngwsimpson0050_3-1752858691203.png

wsimpson0050_4-1752858721210.png

 

 

 

0 Kudos
Message 1 of 12
(203 Views)

I would also like to have the unix epoch time converted to human readable date in UTC if possible.

0 Kudos
Message 2 of 12
(171 Views)

Hi w,

 


@wsimpson0050 wrote:

I currently having a working project where my FPGA is taking samples from an ADC and timestamping them. 


Your FPGA VI stuffs sample triplets into the FIFO, consisting of timestamp, AI0, AI1.

 


@wsimpson0050 wrote:

The problem is, I only want one time reference but currently my program is taking a timestamp and adding it an array over and over ( its the same timestamp). 


Because your FPGA VI is doing what you have programmed to do: placing the timestamp into each triplet of samples!

 


@wsimpson0050 wrote:

I just need help or a code snippet of some sort array manipulation to help me sort the array into a format I want.


  • Get a multiple of 3 samples.
  • Decimate into 3 arrays: timestamps, AI0 data, AI1 data
  • Use only one timestamp sample, but all AIx samples…
Best regards,
GerdW


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

Thank you, I will try to implement that and get back to you.

0 Kudos
Message 4 of 12
(133 Views)

I am able to decimate into 3 separate arrays but it still keeps every timestamp. How do I only keep the first instance? Understand that I have no (zero) LabVIEW background and this is all very new to me, thanks!

wsimpson0050_1-1753113462275.png

 

wsimpson0050_0-1753113416899.png

 

 

0 Kudos
Message 5 of 12
(129 Views)

I found another issue... The time data (and I assume the actual data) is switching columns, not good.

wsimpson0050_0-1753119195746.png

 

0 Kudos
Message 6 of 12
(118 Views)

Hi w,

 


@wsimpson0050 wrote:

I am able to decimate into 3 separate arrays but it still keeps every timestamp. How do I only keep the first instance? 


Sure it keeps all the data as you create a 2D array from ALL your decimated data immediately…

 

How should the result look like?

Where do you want to place that single timestamp with all the other AI0/AI1 samples?

 


@wsimpson0050 wrote:

Understand that I have no (zero) LabVIEW background and this is all very new to me, thanks!


But still you want to handle a LabVIEW project using 3 different targets (FPGA, RT, pc host)? As a "jump into deep water" beginner project?

 

When this is "very new" to you then you should start with all those Beginner resources offered at the top of the LabVIEW board!

(I explicitely want to emphasize this is a "friendly recommendation" and not as a "harsh comment".)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 12
(116 Views)

Hi w,

 


@wsimpson0050 wrote:

I found another issue... The time data (and I assume the actual data) is switching columns, not good.


Did you read a multiple of 3 samples as your FIFO data consists of triplets?

Do you handle a (possible) FIFO overflow?

Best regards,
GerdW


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

Thank you for your concern, I either sink or swim in this deep water. I prefer to swim; I am just looking for a float. This system should be stand-alone, no host computer required. 

For this system I need: 

1.) To take ADC samples at 100Khz 

2.) Timestamp the first sample (using the PPS from the 9467) or every PPS, needs to be extremely accurate

3.) Save and Log the data onto an SD card that is on the cRIO

4.) Do all of this without a computer/laptop

If you believe I would be better off by doing those tutorials and coming back to this I will.

0 Kudos
Message 9 of 12
(110 Views)

Hi w,

 


@wsimpson0050 wrote:

If you believe I would be better off by doing those tutorials and coming back to this I will.


Yes.

 


@wsimpson0050 wrote:

2.) Timestamp the first sample (using the PPS from the 9467) or every PPS, needs to be extremely accurate


Please define "extremely"…

 


@wsimpson0050 wrote:

3.) Save and Log the data onto an SD card that is on the cRIO


Which file format?

Did you consider using TDMS files?

Did you consider using DAQmx logging into TDMS?

(You may consider saving your PPS data with timestamps from DAQmx to allow data correlation/analysis in post-processing…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 12
(92 Views)