LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI into buffer - fast as possible

Hi Everyone,
 
Im trying to make my program run as fast as possible. There are two tasks, one writes an AO and the other measures multiple AIs. At the moment its taking just under a ms to do 1 itteration of the loop which is nowhere near fast enough. Im defining the tasks outside the loop. In the loop the first frame writes an analog out, the second waits for a trigger for the AI measurements, waits till done then stops.
 
The code is below,
 
cheers.
Mike
0 Kudos
Message 1 of 2
(2,575 Views)
Hi Mike,

I have had a look at your code and made some minor changes. If you want your code to run as fast as possible, I would advise minimizing the use of local variables. They create race conditions where your time is lost. Inside your for loop, you have a sequence structure, which I am not sure if you need it? You are changing the value of the boolean from true to false again and again for every iteration (which I don't see the point of?). What you want to perhaps do is to have the sequence structure outside the for loop (use a flat sequence structure). Also, you are only taking error of one task into consideration, you need to use the "merge error.vi" to merge these together.You might find the synchronization in NI-DAQmx section helpful.

Regards,
0 Kudos
Message 2 of 2
(2,553 Views)