05-03-2017 09:54 AM
Hi,
I have a PXI-1044 rack with a MXI connection. I have NI PXI-6143 cards.
I count edges from an incremental quadrature encoder (A,B,Z).
I read AI signals (voltage, current, torque), it is hence important that I can buffer the data and synchronize it with the same sample frequency as the other signals (+/- 10kHz).
Does someone have an idea how to start with it?
Regards,
BaWy
05-03-2017 11:37 AM
Um, my best idea for starting with it might be, "Don't".
A super quick look at specs for that card show that it has 24-bit counters, so I suspect it uses the old DAQ-STC timing chip. Those counters cannot directly interface with a quadrature encoder. There were some old tricks that usually mostly worked almost correctly, back when there wasn't much alternative, but that's not really such a great end goal.
Now, that said, maybe you're stuck with that board and have to make the best of it. If your motion is truly unidirectional, including no vibration when stopping, you might be ok. If you have bidirectional motion or vibration you either need an external quadrature decoder or a data acq board whose counters support quadrature. (I'd start by looking at the X-series if your chassis has slot support, M-series if not.)
The way to sync the tasks is to share the AI Sample Clock by configuring the counter task to use it as its own sample clock. Then you need to make sure to call DAQmx Start for the counter task before you call it for the AI task. Understand that the count register may increment to some non-zero value before the first AI Sample Clock edge comes in to sample it. Then realize that you should retrieve data from the tasks in same-sized chunks to keep the data streams in sync.
Below is a quick and *incomplete* snippet to illustrate key points. It is *not* complete and ready to run, it just shows how to do those specific things I referred to.
-Kevin P
08-10-2021 10:08 AM
Thank you for your reply. I tried what you have suggested. I write the code for the generation of digital pulse with hardware timing with the help of DaqMx Timing(Sample Clock) for only one channel. But the timing resolution is not good here also I have attached a photo of the output(Oscilloscope signal) where you can easily see the discrepancy which was I think less in the software timing Vi(the previous one). This Vi is only for one channel for more I have to share the sample clock but at the first stage itself it is showing this issue. Please have a look and give some suggestions.
08-10-2021 10:32 AM - edited 08-10-2021 10:43 AM
Sorry I mistakenly reply in this thread. I have copied my reply to the original thread. Please ignore here.