LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting a VI that uses Traditional NI-DAQ to NI-DAQmx

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 6
(2,708 Views)

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.

Kelsey W.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(2,652 Views)

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.

0 Kudos
Message 3 of 6
(2,619 Views)

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)?

 

 

Kelsey W.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 6
(2,573 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(2,564 Views)
Solution
Accepted by topic author The_Prisoner(No.6)

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

Download All
0 Kudos
Message 6 of 6
(2,469 Views)