LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I do a buffered digital acquisition on a single line?

I am using a NI PCI 6110 DAQ and I need to do a continuous buffered data acquisition (sample rate near or above 5 kS/s). The thing is, the acquisition must be done on a single digital line. Some other lines of the digital port are used for something else (some in write mode, others in read), so they have to remain unaffected by the process.

It would certainly be better if it could acquire data at the same speed as an analog input (which will be executing at the same time). In fact, it would have been much easier to only add a channel to the AI and I would have got exactly the results I want, but all the AI (4) of the board have already been used 😞 .

The picture I uploaded shows what I'm tryi
ng to do: I acquire analog data and I want to automatically show the moment a deconnection occured. The purple/pink line, which I added manually, is the one causing me trouble. It shows the voltage (0-5V) of the relay doing the deconnection (that's why it have to be done at the same time than an AI data acquisition).

Thanks for reading this to the end 🙂
0 Kudos
Message 1 of 4
(2,753 Views)
Well, you can't get hardware-timed DIO with the 6110, but you can probably use its counters to capture the timestamp you need.

One method would be to set up a buffered edge-counting task. The analog input's sample clock would be specified as the source signal. This will cause the counter's value to increment at the beginning of each sampling cycle, acting as a measure of time from the start of analog input.
The falling edge of the relay signal would be the counter's gating signal. For each instance that the relay disconnects, the count value ("time") at that instant will be stored in the counter's buffer for subsequent retrieval.
Note one small timing subtlety: while the very first sample clock edge puts analog data into the 0th array inde
x, it will also be incrementing the counter time to 1. This off-by-one deviation will persist.

There are other variations on this theme, depending on whether you also need to capture re-connection times, or whether there is always one and only one disconnect of interest, etc. You can likely get just the behavior you need using one or both of the on-board counters.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 4
(2,753 Views)
Thanks for the answer, but I can't unfortunately test it right now because one of our devices broke down. When everything will be alright, I will give you a feedback.
0 Kudos
Message 3 of 4
(2,753 Views)
Our system is working again, but since I'm not a very experienced Labview user (I used it for the first time less than 3 months ago), I'll sacrifice one of our analog input for now. I saw that I forgot to mention that there is always only one disconnection.

If I have some spare time before the end of my project, I'll spend some time trying your method. Until then, I have many other things to do. I have to say that I didn't thought that it would be something really simple to do that I hadn't seen.

Thanks again! If I get the time to try it, i'll post again.
0 Kudos
Message 4 of 4
(2,753 Views)