Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I continuously acquire analogue data and set markers in it corresponding to a trigger?

I am using a high speed AD card (PCI-6111E) to acquire signal data from 1 or more channels (C++). I have an associated analogue trigger signal which essentially gives me a state change (Hi->Lo or Lo->Hi) at the start of each new block of data = end of the previous block (it's a once per rev signal on a rotating target).

What I really want to do is acquire data continuously, using double-buffered acquisition, and have this trigger signal as a marker into the buffer so I can split my acquired data into blocks. Is this possible?

Currently I use the trigger to start acquisition then grab a block that is large enough to contain a full rev of data. I also acquire my analogue
trigger signal as an input and find the end of my rev by analysing that. I do not just want to use the trigger signal as a stop trigger as well as start trigger as I will 'miss' data inbetween the acquisition stopping and being restarted.

Any suggestions.
0 Kudos
Message 1 of 4
(6,356 Views)
Hi CAS,

There are only a couple ways to perform this operation and neither of them are perfect for what you are looking for. The first method is the one you described in your post; acquire the digital signal and analyze it post acquisition.

The second method is to route the scan clock to the source of a counter and have your trigger signal on the gate of the counter. Your counter would be configured for buffered period measurement. What this will do is that it will record how many samples have passed in between trigger pulses. Therefore, you should be able to easily tell how to break up your array. This can even be done automatically in software by using array subset functions. You would basically associate a block of data with the numeric numbe
r returned from the counter.

For example, if your acquisition acquired 59, 68, 45 points between 3 trigger signals, your counter buffer will have 3 numbers (59, 68, 45). You will then be able to use your counter buffer to break apart your array into smaller segments of 59, 68 and 45.

Anyway, hope that helps. Have a good day.

Ron
Message 2 of 4
(6,356 Views)
Thanks Ron, that information was very useful. I have now managed to successfully acquire data from an analogue input, using countinuous double-buffered acquisition whilst also continuously acquiring the period measurements using the counter.

My only remaining problem is that I can't get the two acquisitions to start at the same time. I can get the analogue acquisition to start from my external trigger but not the counter. Looking at the NI-DAQ help, the ND_START_TRIGGER parameter is not valid for my card (PCI-6111E with DAQ-STC) and I get an error message when I try and set this parameter to ND_ENABLED using GPCTR_Change_Parameter().

Is there any way of ensuring the acquisitions start at the same time? I'm not convinced that just triggering them both fro
m my external source will do the trick as they are 2 cycles out at just 100Hz trigger. (I am arming the 2 acquisitions in successive lines of code and not doing anything to cause a delay between).
0 Kudos
Message 3 of 4
(6,356 Views)
Hi CAS,

The error you are seeing when configuring the ND_START_TRIGGER is valid. The DAQ-STC counters don't support a start trigger (only 660x devices w/ NI-TIO chipset).

What you should do is start your counter application first before you configure your analog input application. The reason for this is that the counter arms and starts counting immediately in Buffered Period Measurement mode (even if no pulse has appeared on the gate). When it receives the first rising edge it latches the current count and restarts counting. This means that your first count value will be invalid! Your second count will be synchronized with the start of your acquisition. Therefore just set up your code to ignore the first count and it should be synchr
onized quite nicely.

Hope that helps. Have a good day.

Ron
0 Kudos
Message 4 of 4
(6,356 Views)