Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I have problems for to use Start function inside a case structure.

I am doing data acquisition using the Config, Start and Read functions, all them inside a while loop. I want to use Config function only when certain conditions occur, so I put the function inside a case and no problem. But when I put the start function inside the same case, the acquisition is not good. Please view my attachment. My application is client-server type.
0 Kudos
Message 1 of 3
(2,250 Views)
Boxer,

I checked your example and have several easy but important suggestions for you:

1.- First, make sure that the first time you initialize the VI, the AI Config and AI Start are executed, because based on the debug I made, your program doesn't do it, and this is very important.
2.- Add an AI Clear after the acquisition is done, so that you release the resources. This is a good programming technique, and may help you solve your issue.
3.- Add an Error Cluster, so that you know if an error occurred at some point of the acquisition. This will help you track the issue.
4.- What do you mean by "the acquisition is not good". What does it happen? What does it do? Do you get an error? <- This is the reason of step 3.
5.- Finally, if you have doubts
programming AI, check one of the shipping examples of LV. They can give you a much clearer idea.

Hope this helps,

L Aguila
Applications Engineeer
National Instruments
Message 2 of 3
(2,250 Views)
Hello;

That is not the best way to program a DAQ task. Once you have the AI Config, AI Start and AI Clear inside a while loop, all the acquisition parameters are dowloaded to the DAQ board at every loop iteration.

That makes you application extremely ineficient. The way to go about that is to have those VIs outside the while loop and only the AI Read inside of it.

The best way to get started is by looking at the Serach example named Continuous Acquisition and chart (buffered).vi.

Hope this helps.
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,250 Views)