LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using asynchronous AI for single pt acquisition

Hi,
I'm trying to create a program which can continuously read data in one while loop, while simultaneously performing another. For the gathering of data I'm using a single pt acquisition and I assume the problem is that it is a synchronous operation. However, I do not know how to create an asynchronous single pt analog input. I would appreciate any help. I've included the .vi below, the code is a bit messy and will be slow running, but for the application I'm using I don't need the program to execute that quickly. I'd appreciate it if someone could point me in the right direction. Thanks,

Jack F.
0 Kudos
Message 1 of 2
(2,373 Views)
"A bit messy" doesn't begin to describe your program but your main problem is that you're wired values from outputs in the top while loop to inputs in the bottom while loop. You've created a data dependency such that the bottom while loop won't start until it has valid inputs and there won't be any valid inputs until the top loop finishes. If you want a quick and dirty solution, you can use local variables inside the while loops and pass data that way. You also might want to think about not starting anything in the bottom while loop until you have 6 valid measurements. Look at the synchronization functions (i.e. set occurance).
0 Kudos
Message 2 of 2
(2,373 Views)