From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combing mixed data sources for TDMS

I have an FPGA VI running on a cRIO 9068 which puts samples from four channels of a 9205 ADC into a Target to Host DMA FIFO. The host VI runs on a Windows machine and (among other things) writes the samples to a TDMS file. I appear to have that working successfully at 1KHz. The host VI is also running a Modbus TCP Master VI which communicates with an Emerson VFD. Its max polling rate is about 250ms.

 

What I'm currently having issues with is how best to combine these two data sources (the fifo stream and one-dimentional data from the Modbus VFD) into the data array that's being fed into the TDMS write block. My current approach is to convert the fixed point data from the FIFO to doubles. This is then fed to a Decimate 1D Array block to split each channel of data from the FIFO into individiual "appended arrays". The four outputs from the Decimate 1D Array block feed directly to a Build Array block. Currently the Build Array block has 5 inputs - four from the preceeding Decimate 1D Array block, and a 5th that's from the Modbus data (happens to currently be RPM).

 

Here's the issues I'm having:

 

If I try to directly feed in the Modbus data into the Build Array block the block changes its output type from a 2D array to a 1D array. Presumably the block defaults to the "lowest common denominator", which is the single input value from the modbus data. My next attempt was to use a Type Cast block and convert the modbus value to an "appended array". This "works", in that Labview doesn't complain, but in the resulting TDMS file the modbus variable is mostly zero, and will only ocassionally be written as a (proper) non-zero value. Obviously the typecast to an array results in mostly zeros.

 

So my question is:

 

What is the proper way to combine this stream of data from the fifo with "regular" one dimentional data?

 

In the attached VI the TDMS Loop is the one in question.

 

Thanks!

 

Jesse Dosher
Senior Electrical Engineer
Applied Physics Lab, University of Washington
Download All
0 Kudos
Message 1 of 4
(3,143 Views)

I would just write to two different groups in the TDMS file, one for the FPGA stream and one for the Modbus update.


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
0 Kudos
Message 2 of 4
(3,121 Views)

Thanks for the tip. I've modified my VI to write to asynchronous to two groups, similar to what's in this post

 

https://decibel.ni.com/content/docs/DOC-23122

 

One thing I'm having trouble with is the fact that one group is a DMA fifo from the cRIO FPGA with data being put into it at 1KHz, while the other is single values that are being refreshed (via modbus) at 250Hz. How can I align this data in the tdms file?

 

I'm sure I'm doig this quite right.

 

 

Jesse Dosher
Senior Electrical Engineer
Applied Physics Lab, University of Washington
0 Kudos
Message 3 of 4
(3,086 Views)

jdosher wrote: How can I align this data in the tdms file?

In the file, you don't.  Just log all of the data in their separate groups at their own rate.  If you make a viewer, just make extra samples of the modbus data to act as filler between samples to match the cRIO data.  You can do that with interpolation or simply duplicating your data points.


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
0 Kudos
Message 4 of 4
(3,079 Views)