LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why do I get Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.

Solved!
Go to solution

Possible reason(s):

Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.

When writing, supply data for all channels in the task. Alternatively, modify the task to contain the same number of channels as the data written.

Number of Channels in Task: 8
Number of Channels in Data: 1


0 Kudos
Message 1 of 5
(5,530 Views)

I don't have your hardware. Which function generates the error? Are your task settings identical to the current default values of the controls?

 

(What possesses you to use a stacked sequence at all here?)

0 Kudos
Message 2 of 5
(5,524 Views)

The DAQmx Write vi is giving me the error. If I run a single channel, not a problem. Multichannel gives me the error.

 

I did a sequence to make sure each function was performed in the correct sequence. Didn't want a race condition.

0 Kudos
Message 3 of 5
(5,509 Views)

OK, see if I can figure out how to produce data for all channels at one time.

Thanks

0 Kudos
Message 4 of 5
(5,506 Views)
Solution
Accepted by topic author larr

@larr wrote:

The DAQmx Write vi is giving me the error. If I run a single channel, not a problem. Multichannel gives me the error.


You are funny! Why do you attach the working VI (single channel) instead of the one giving you errors (multichannel)?

 

(If you car does not work, you wouldn't bring your wifes' car to the mechanic, right!)

 

What is the exact text in the "physical channels" control when you do multichannel AO?

 

 


@larr wrote:

I did a sequence to make sure each function was performed in the correct sequence. Didn't want a race condition.



All you need to do is wire the error from "start task" to the error input of the first DAQ assistant and then back to "stop task" and things will execute in order. Guaranteed! Think dataflow! Everything else can execute in parallel or the order is irrelevant.

 

First convert the stacked sequence to a flat sequence, remove the flat sequence, and add the mentioned wires. Now do a "cleanup diagram". 😄

 

A stacked squence with sequence locals is one of the worst constructs you can possibly do. It makes the code hard to debug, hard to follow, and impossible to maintain.

Message 5 of 5
(5,504 Views)