LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition and logging of a Dynamic signal acquisition module(NI-9234) using an FPGA(NI cRIO 9041)

I have an accelerometer coupled to a compact RIO controller cRIO-9041 via the NI 9234 module. As this module is a DSA module, one needs to start and stop the acquisition to make sure that it is scanning. I have currently set the data scan rate, set the acquisition to start and use a FIFO buffer transfer it to the RT host to plot it on a

waveform chart and simultaneously log it to TDMS file.

 

Having followed an older example (compatible with LV 2012) here:

https://forums.ni.com/t5/Example-Programs/Acquisition-and-Data-Logging-of-Vibration-signals-on-Compa...

 

Any insight on where I am going wrong is highly appreciated.

 

I have managed to get the module to acquire readings at a deterministic rate. While the FIFO buffer isn't overflowing, the recorded values are not right (i.e, a flat line even when I am shaking it).  

 

The FPGA.vi:

FPGAviforQ1.png

 

The RT.vi on the x86 host:

RTviforQ1.png

 

As for the FIFO buffer used, the data type is set to Fixed point with signed 26 bit word length and 5 bit integer length. 

 

My reasoning behind the choice of FIFO Read parameters is:

1.  There are three inputs scanned @ 1.652 kHz simultaneously, i.e., there are roughly 5000 samples (~4956) captured every second. In other words, around 500 samples every 100 milliseconds. Rounding to the nearest multiple of 3, I have chosen to read 501 samples.

2. The timeout is the standard recommendation from the documentation page.   

Download All
0 Kudos
Message 1 of 8
(2,553 Views)

Hi,

 

I cant comment directly on the code as I am not on my development machine at the moment. I can make some comments on your code pictures though:

 

  • The Mod1/Stop will never fire as the while loop will never stop.
  • There are lots of FXP coercion dots. As a general rule, coercion dots should be avoided on FPGA. These coercions could result in the flat values you are seeing. I cannot check the code to confirm this isn't the case! Double check that flat values come in through the FXP on the RT.
  • I use prefer using decimate/build array to perform the reshape action. I have always had a hard time getting reshape to do what I want, but decimate works simply. I haven't benchmarked it though!
  • I wouldn't use the wait to control the rate of your RT.vi. The rate can be controlled entirely by the timeout on the FIFO Read.

The code is really simple and should work, so the only real cause I can think of is the coercion of the FXPs. An overflow can cause flat values, but you say this doesn't ever turn on, so its not that.

 

Max

CLA - Kudos is how we show our appreciation for comments that helped us!
Message 2 of 8
(2,529 Views)

I see the "stop scanning" not being executed. I have edited the VI to stop scanning the module, change the data rate if required and then start scanning. The only reason I need to stop scanning is to sample at a known rate rather than some random rate previously used. That part is fine now, thanks for that.

 

As for the fixed point coersion, I have the removed the FXP conversion blocks so it is only converting it after the display:

FPGAviForQ1Follow.png   Note: I changed the module slot to check if it's not some issue with the slot, so please ignore the change in the module number from the original question.

 

So with this change the display should show double values. And it still shows near zeros:

FPGAfrontpanel.png

 

I later checked if there is something wrong my accelerometer sensor by using a cDAQ 9171 lying around and it works just fine on that:

AcceleroTestingonCDAQ.png

The settings I used for the DAQ assistant for the measurements taken on the cDAQ 9171:

AcceleroTestingonCDAQSettings.png

0 Kudos
Message 3 of 8
(2,523 Views)

Hi Bala,

 

you apply some "Sensitivity" scaling in the DAQ assistent.

Do you apply the very same scaling in your RT/FPGA VIs?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(2,518 Views)

Yes. It was by default present in the DAQ assistant. So just to see if thats where I am going wrong, I added a scalar gain and saw that while  the values are oscillating they are not correlating to the way I am shaking it. So I guess thats not it. 

0 Kudos
Message 5 of 8
(2,515 Views)

Hi Bala,

 

what about those excitation settings?

Best regards,
GerdW


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

I added a property node for the module and it's individual channels and set all their values to match the DAQ assistant. SettingsOffered.png

 

As for the excitation current, the module offers only one amplitude of 2A. Couldnt change it on the DAQ assistant and there is no property for the module to change it too. These are the only configurable properties of the module except Serial Number and ID.

 

The acclerometer is a Kistler 8763B050BB if that helps. It has a range of +/- 50g with o/p nominal voltage +/- 5V (so sensitivity is around 100mV/g). I will be applying a scaling factor later so I am not concerned with the actual amplitude as much as I am with the trend (time series variation). Thank you very much for following me with questions on this one.. 

0 Kudos
Message 7 of 8
(2,504 Views)

I added a property node for the module and it's individual channels and set all their values to match the DAQ assistant. SettingsOffered.png

 

As for the excitation current, the module offers only one amplitude of 2A. Couldnt change it on the DAQ assistant and there is no property for the module to change it too. These are the only properties of the module except Serial Number and ID.

 

The acclerometer is a Kistler 8763B050BB if that helps. It has a range of +/- 50g with o/p nominal voltage +/- 5V (so sensitivity is around 100mV/g). I will be applying a scaling factor later so I am not concerned with the actual amplitude as much as I am with the trend (time series variation). Thank you very much for following me with questions on this one.. 

0 Kudos
Message 8 of 8
(2,503 Views)