05-09-2016 05:53 PM - edited 05-09-2016 05:54 PM
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!
05-09-2016 08:37 PM
I would just write to two different groups in the TDMS file, one for the FPGA stream and one for the Modbus update.
05-16-2016 06:18 PM
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.
05-16-2016 07:31 PM
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.