08-31-2009 07:24 PM
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
Solved! Go to Solution.
08-31-2009 08:02 PM
08-31-2009 08:06 PM
Hi, Adnan.
Which examples do you mean?
Best,
Jay
08-31-2009 08:19 PM - edited 08-31-2009 08:21 PM
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.
09-01-2009 09:58 AM
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:
DAQmx:
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