08-06-2018 06:46 PM
Hi everyone,
I need your help with this situation. Here is some information about my project.
NI USB-6501
NIDAQmxBase370, NIDAQ1501f3
Visual C++ 2008, Windows XP
What I need to do is:
There is a periodic signal input from the board to my computer.
The input period is ~ 330 ms. The pulse width is ~ 0.7 ms.
I need to deal with something every time the pulse appears.
I tried to do this by reading continuously, but some of the pulses were missed because my program can only deal with this data-reading thread every 1 ms.
Is there any smarter way to do this please?
I would have a help with this if possible.
Thank you very much!
Best Regards,
Liyan
Solved! Go to Solution.
08-08-2018 09:59 AM
Hi Liyan,
A couple thoughts:
It's not recommended to have DAQmx and DAQmx Base installed on the same computer. DAQmx Base has less features, and can actually override DAQmx as your hardware driver. I would uninstall it and then run a repair installation of DAQmx 15.0.1 to make sure all hardware is recognized properly.
If the timing between [trigger received] and [thing done] is important, then this hardware probably isn't the best tool for the job. The USB-6501 is meant for data acquisition rather than software control. Accurately controlling software based on a hardware trigger would require an FPGA solution.
If an "approximate solution" is sufficient, you could read data in 1ms chunks (eg 100 samples at 100 kHz) and parse that array of data for a rising edge. Just search the array for the subarray [False, True]. Make sure to watch out for the possibility of the rising edge being the first data point in an array (the last point of "lastArray" is False, but the first point of "currentArray" is True)
08-08-2018 01:56 PM
Thank you so much!
I will try to find other ways to do this.
Best,
Liyan