12-01-2017 09:06 AM
I have an array of "activate" controls which enable a physical DAQ channel. All active channels will be added to a new task. Each channel has a further control "offset" which is supposed to be set during execution. For example: I have an array of 6 "active" controls in which I set channel 1,2, and 5 to active (thus these channels are querried for values by DAQ). Now I need to add the offset "control" associated with each channel in a while loop. Since only the active channels are querried for values, I need a way to select only the "offset" controls associated with these active channels. I do not know a solution to this. How can this be done. The "offset" controls will have to be changed during execution. Please see the attached minimalist VI. Cheers
Solved! Go to Solution.
12-01-2017 09:43 AM
I've found a solution using a for loop inside the while loop (see attached snippet). But I find this solution quite ugly. Is there a better way of doing this? In my actual application I need my while loop to iterate as fast as possible and I dont want to repackage the active arrays each time.
12-01-2017 10:12 AM - edited 12-01-2017 10:13 AM
Learn to use Autoindexing output tunnels. They allow LabVIEW to make a bunch of optimizations over the Insert Into Array with a Shift Register. And you can even make them "conditional" with a simple right-click menu.
So here is what it looks like after I cleaned it up. This is probably going to be the simplest solution.