LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in converting DAQ to DAQmx

Solved!
Go to solution

Hi,

 

I've struggled with coverting traditional DAQ to DAQmx for two weeks. I really need help from someone.

As you can see the picture below, I've tried to replace the old VI's with new ones. But, it doesn't work. Of course, the VI below is just a part of my VI. VI's after case structure are inside of while loop.

Could you please give me thought that why it doesn't work?

 

FYI: The strange thing about it is that it runs without any error messege, but there is no actual output (values on the graph, data in arrays, etc).  

 

Thanks in advance.

 

Best,

Jay

 

 

untitled.JPG

0 Kudos
Message 1 of 5
(3,013 Views)
If you open up the examples in the Example Finder (Help -> Find Examples), do they work for you?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 5
(3,011 Views)

Hi, Adnan.

 

Which examples do you mean?

 

Best,

Jay

 

0 Kudos
Message 3 of 5
(3,008 Views)

That VI cannot run without errors and if you would wire up an error indicator, you would probably see it.

 

The reason I say it can't run without errors is that you cannot use both the traditional DAQ driver and DAQmx on the same device at the same time.

 

And, the examples are right where you were told they are.  Expand the listing under Hardware Input and Output and look for DAQmx.

Message Edited by Dennis Knutson on 08-31-2009 07:21 PM
0 Kudos
Message 4 of 5
(3,000 Views)
Solution
Accepted by topic author jeongho20000

Hi Jay,

 

Assuming that the Traditional DAQ and DAQmx code are screenshots from separate VIs, I believe that the following parameter of the read functions in each driver would account for the different behavior that you are seeing (you have both set to -1):

 

Traditional DAQ:

Traditional_DAQ_Scans.PNG

 DAQmx:

DAQmx_Samples.PNG

 

So, when you give DAQmx Read a -1 for "number of samples per channel" when running a Continuous task, the effect is that it will return whatever data is available at the time DAQmx Read is called.  In your case this is immediately after the task is started so there very well could be 0 samples available in the buffer.  I'd imagine that you would see data if you change the value of this parameter from -1 to the actual number of samples that you want to read.

 

 

Having said this, if you want to acquire continuously you should call DAQmx Read from inside a loop.  I agree with the others that you should take a look at the DAQmx shipping examples to help get started, you will probably find something very close to what you want to do.  You can find the examples at:

 

Help >> Find Examples... >> Hardware Input and Output >> DAQmx

 

 

Thanks for posting, I hope this helps!

 

-John

John Passiak
0 Kudos
Message 5 of 5
(2,974 Views)