04-03-2020 08:23 AM
Hi everybody,
I'm quite new to Labview and here is my problem:
I'd like to use +/-20 outputs at a DAQ
the wizzard does not work, why i change this to DAQmx code:
(which work perfectly)
If I do this for 20-30 Outputs, this will result in a bunch of code.
Is there an easier way of creating this / with e.g. loops?
additional:
can I use "several" error lines or should I connect every block before the while loop and then all blocks within the loop?
Thanks in advance!
Solved! Go to Solution.
04-03-2020 08:44 AM
@WWolf78 wrote:
Is there an easier way of creating this / with e.g. loops?
Yes, use a FOR loop. You should Make an array of the channels you want and create the tasks using autoindexing on the FOR loop. You can do something similar for the writing: autoindex on the array of tasks and an array of the values you want to write.
04-03-2020 09:10 AM
Thanks for the Tip!
will the for Loop then create an "task array"?
the Values to write are not fixed, the user can switch them on/off as required.
how can I solve this as easy as possible?
04-03-2020 10:12 AM
@WWolf78 wrote:
will the for Loop then create an "task array"?
Yes. You autoindex the created tasks out of the initialization FOR loop.
@WWolf78 wrote:
the Values to write are not fixed, the user can switch them on/off as required.
Use Build Array to combine all of your values into an array and then a FOR loop to write them.
04-06-2020 02:06 AM
"Use Build Array to combine all of your values into an array and then a FOR loop to write them "
as the Tasks I'll perform on an pressed button are quite fast (switching an output on/off), would be an event structure a better solution?
otherwise, on every instance I'd have to create the boolean array and analyze, if any button has been switched and then perform the equivalent action.
04-11-2020 01:06 PM
that's the solution:
Easy and (I think) quite short.
Tanks for the Help!!