Interrupt triggered DMA

I’m trying to use an analog accelerometer to measure impacts.
To do that, I’m using an interrupt on an Analog Trigger to wait for an impact, and Direct Memory Access to acquire the data.
However, there appears to be an issue with DMA carrying over data from the last acquisition, despite my “read” telling me there is no more data.
Here’s a screenshot of my VI:

The vertical line in the graph about 0.2 seconds in is what I’m referring to. (Please ignore the incorrect date in the timestamp)

In addition to this issue, I was wondering if there was a good way to capture the moment of the impact. Continuously acquiring with DMA doesn’t sound very efficient (though it would remove the need for an interrupt).

I’ve uploaded the VI for your review. It’s not neat or documented at the moment, but I can improve that if you would like.

High speed DAQ.vi (36.4 KB)


High speed DAQ.vi (36.4 KB)

Actually, if acquisition or transfer has any significant setup time, the typical solution is to do acquisition and then trigger after the acquisition to determine what it is you’d like to retain and log. As for efficiency, try it and measure. Many of these resources are HW capabilities and don’t tax the cRIO too much.

Greg McKaskle

Okay, I’ll try that.
I suppose I could also log the 5v supply at the same time to take out the noise.

In certain automotive modules, data like that is logged and stored by using a circular buffer that is updated every sample (i.e., data is ALWAYS being logged). When a worthy trigger event occurs, data from X sample before the trigger and Y samples after the trigger are then set aside to be written to non-volatile memory.