05-29-2014 07:06 AM
Hello,
I am trying to convert a VI that uses Traditional NI-DAQ to NI-DAQmx. I am almost there, but when I run my new version the "number read" and "scan backlog" do not come back the same.
In the original version the "number read" always came back as 1 and the "scan backlog" always came back as 0.
In the new version the "number read" and "scan backlog" could come back with any value. This is of course throwing off my recording of measurements and how the VI's interact with the rest of the program.
I have attached a stripped down version of the VI's for the Old Traditional NI-DAQ and New NI-DAQmx that demonstrate this problem. Both VI's are written in LabVIEW 2011 SP1. I would be willing to upgrade to LabVIEW 2013 SP1 if that would help solve the problem.
I would appreciate any guidance.
Thank you in advance.
Solved! Go to Solution.
05-30-2014 02:19 PM
Hello,
Have you seen the following White Paper that goes through some tips and tricks about transitioning from NI DAQ to DAQmx?
http://www.ni.com/white-paper/4342/en/
Take a look at it and see if it helps you resolve the problem you're having.
06-02-2014 12:02 PM
Thank you Kelsey. I actually printed out a copy of that White Paper. It was extremely useful. It is the reason that I have gotten as far as I have.
06-04-2014 01:55 PM
You could try setting breakpoints and probes in the new VI and old VI to see where discrepancies occur. I'm guessing we could rewrite your code to achieve the same functionality using DAQmx. What are you hoping to gain by extracting these two pieces of information in your program (number read and scan backlog)?
06-04-2014 02:17 PM - edited 06-04-2014 02:19 PM
There's no need to use the scan backlog and loop around the samples, just wire 1000 as samples to get and it'll wait until it has 1 sec buffer and return the array. Easy as pie.
Also, clearing the task if it doesn't exist can cause an error meaning it wont read at all, you should only clear the task if Task != empty.
/Y
06-19-2014 12:46 PM
I think that I have done it. Use a -1 to clear everything in the buffer when the program is waiting for the countdown to finish and then just ask for the 1000 measurements when the countdown hits 0. Do not need the Scan Backlog or the Number Read. Also don't need to add the measurments into the array 1 at a time because I am getting them all at once.
I have attached a copy of my solution for anyone who might need to do something similar in the future.
Gary