Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

create several tasks at once

Solved!
Go to solution

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)

WWolf78_0-1585920014998.png

 

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!

 

 

 

 

0 Kudos
Message 1 of 6
(2,120 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,109 Views)

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?

0 Kudos
Message 3 of 6
(2,102 Views)
Solution
Accepted by crossrulz

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(2,086 Views)

"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.

0 Kudos
Message 5 of 6
(2,029 Views)

that's the solution:

 

WWolf78_0-1586628299821.png

 

Easy and (I think) quite short.

 

Tanks for the Help!!

0 Kudos
Message 6 of 6
(1,995 Views)