LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquisition of data from high frequency sensor (LabView, RT, FPGA)

Hi,

I am a beginner in using Labview. As a part of my project I need to do some measurement of vibrations. I have NI cRIO 9074 control board and module card  NI 9239 (2 pieces). On input channels  NI 9239 I receive input from acceleration sensors (SILICON DESIGNS). I need to make an application in Labview, which would do the acquisition of data from these sensors (sampling of analog signal from the input) with frequency of minimum 1 kHz, and which would then write this measured data to the disk.

I managed to connect the hardware and start the system. I wrote the whole application for acquisition in RT mode, but the problem occurs in achieving the desired frequency. In order to achieve sampling frequency of 1 kHz I need to have a loop which takes no longer than 1ms to complete each iteration. But due to the complexity of the task and number of operations, my program needs 3-4 ms for one iteration, and therefore my sampling frequency falls to 250-333 Hz. I already analyzed my program, and I have simplified it to the maximum. I concluded that the biggest time loss is in writing the data to the file. I used  Shift Registers and writing to an Array (in the link below there is an example, its for logging only 4 channels but the principle is the same). I have also tried writing the data with TDMS but I don’t get better results.

I thought that FPGA programming will make it possible to achieve what I want, so I tried it also. But I didn’t succeed. I used hybrid approach (target to hots), and FPGA provides very fast reading of data from the sensors. But since the data saving operation is done in host, on RT, again it needs too much time to write this data to the disk. I thought about making a FIFO buffer and to log the complete measurements into it, and to write to the disk after the measuring is over. But I don’t know if it’s even possible due to the big amount of data, or if it is possible to do something like that with FIFO...

So if you could please help me, I’m out of ideas?

Has anyone done some similar applications?

Is my approach to the problem good, do you have any suggestions?

Should I use RT or FPGA module?

If you have any example, suggestion, any help is welcome.

 

Thanks,

s.m.

0 Kudos
Message 1 of 8
(4,552 Views)

Hi,

 

I cant open the file you attached, the format is .7z?

 

Maybe I am missing something?

0 Kudos
Message 2 of 8
(4,531 Views)

.7z is a compression format http://www.winzip.com/landing/open-7z-file.html


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 3 of 8
(4,526 Views)

@Terry_ALE wrote:

.7z is a compression format http://www.winzip.com/landing/open-7z-file.html


Oh yep, thank you!

0 Kudos
Message 4 of 8
(4,524 Views)

Are you familiar with NI Example Finder http://www.ni.com/getting-started/labview-basics/examples#NI  Example Finder?

I did a search for your AI module and found a number of examples that ship with LabVIEW

9239 examples LV2016.PNG


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 5 of 8
(4,519 Views)

Yes, I'm familiar with NI Example Finder. I have seen all those examples before, but none of them solve my problem. They all perform readings from high frequency sensors on RT or FPGA, and then they send this data from FPGA to RT (target to host) and similar... That is not a problem, I manage to do that.

But the real problem occurs when I need to write the data with great speed to a file (textual, binary...).

0 Kudos
Message 6 of 8
(4,451 Views)

Understood.  Examples are not meant to be complete solutions but parts of what could be.

 

TDMS is a format that can give you high speed streaming to disk:

https://www.ni.com/docs/en-US/bundle/labview/page/standard-versus-advanced-tdms-functions.html

 

Look up TDMS examples and then you may need to combine with these examples.


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 7 of 8
(4,447 Views)

Dear stef.mil,

 

9239 is a DSA c series module (it has a sigma delta ADC inside that is running at a master clock around 12M-13MHz) and the sampling can go only according to this master clock. So few remarks to what you want to do (if I understood it right):

  • look at the datasheet of 9239 (linked above), because of the nature of this, you cannot achieve 1kHz continuous sampling (the term "continuous sampling" is crucial in your "vibro analysis app") - closest f is 1.613kHz (you have just 31 steps to choose from)
  • So you cannot use scan mode for that - in scan mode you are able to time some loop in cca. max. 1ms (with almost nothing done in the loop in case of this low power cRIO), even if with usage of scanned access to the IO nodes you should be able to read something, you will not be able to determine the actual time when the samples would be acquired. In general, to read from DSA AIs using scan mode is a bad idea.
  • the easiest way to do what you want to do would be to use a cDAQ chassis instead of a cRIO and program your app using DAQmx
  • In this HW conf. you need to acquire samples in FPGA and then send them to the RT part via some FIFO for logging in chunks (not sample by sample) - as it was mentioned in the posts, there are examples for that, but you are not using them as i see in your project (even you mentioned that you managed to do that). Also be aware, that in the FPGA part DSA modules require special treatment (start acquisition, then read samples, ... see the examples, they are almost ready to go for your app) 
  • for logging (on RT part), it could be nice thing to implement some producer consumer architecture, just to be sure that you are able to keep up with the acquisition and not loose samples, note, that this cRIO has just very limited storage space on board (that will be also used by your program and the needed SW packages). With high probability you will need to implement also some transfer mechanism from RT to regular PC, and log the data in the PC. Just a estimate of your datastream: 4 modules x 4 CH x 1613Hz x 24b = 76kBps, that means for 1 minute of record you need cca. 4.5MB of storage space (and yes TDMS is a very good format in terms of efficiency)
  • Just google a little bit, there are many projects on our community pages and many white papers / reference architectures / examples , that will require just slight modification, and you can use them
  • 1kHz is not a high frequency

 

Hopefully something of this will be helpful. If not, feel free to use google, or similar, you can find things like:

https://forums.ni.com/t5/Real-Time-Measurement-and/Scan-mode-and-FPGA/m-p/1021076

https://www.ni.com/en/support/documentation/supplemental/08/understanding-ni-compactrio-scan-mode.ht...

https://forums.ni.com/t5/Real-Time-Measurement-and/Write-to-disk-file-from-a-VI-running-on-CompactRI...

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x0UdCAI&l=en-US

http://forums.ni.com/t5/Real-Time-Measurement-and/continuous-acquisition-crio-and-send-by-tcp-ip-to-...

 

B/R

 

Jozef Lipták
Message 8 of 8
(4,428 Views)