03-10-2010 07:00 PM - edited 03-10-2010 07:02 PM
I am trying to output two analog voltage signals simultaneously using Labview 8.2.1. One is a waveform for producing sound and the other is a trigger to another computer (using labview 6.1). I have been getting error -200524 at DAQmx Write. Here is a screen shot of my VI:
The error message says:
"Measurements: 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. "
How can I fix this problem? Thank you.
Solved! Go to Solution.
03-10-2010 10:24 PM
Two problems:
First of all, you are using the "N Channels 1 Sample DBL" instance of the "Write" VI. Use "N Channels N Samples 1D Wform" instead. Click on the polymorphic selector and change it.
Then, you'll need to wire a waveform for each channel, so your input will be a 1D array of waveforms. Element 0 of your array will be the waveform you are writing to channel 0. Element 1 of the 1D array will be the waveform you are writing to channel 1. Don't just wire in a single waveform. If you want to write the same waveform to both channels, use "Build Array" to build the 1D array. Wire the same waveform to both elements of the array.
Please clean up your block diagram, too -- your wires are all over the place and it's a mess. And what do you have that sequence structure for?
03-10-2010 11:45 PM
03-11-2010 12:25 PM - edited 03-11-2010 12:27 PM
I am trying to write different waveforms to each of the two channels. So Channel 0 will output Waveform 0 and Channel 1 will output waveform 1. I used the 1D waveform when I tested out the VI with just one waveform and one channel but I was not able to find a way to have different wave forms for each of the channels simultaneously. The reason I selected the "N Channels 1 Sample DBL" is because that was the only one that made the wire show no errors.
I tried separating the waveforms and wiring them separately but I am not sure how to do that and when I tried it errors occured. Where do I connect the output waveforms from the waveform builder so that I can have them on separate channels? Oh and the sequence structure is to have pauses in the output so that the waveforms are generated in pulses. Thank you.
03-11-2010 12:30 PM
03-11-2010 12:35 PM
You only show one waveform in your block diagram.
Here is a picture which shows what I told you to do in my earlier post.
The waveform wired to element 0 of "Build Array" will be output on channel 0. The waveform wired to element 1 of "Build Array" will be output on channel 1. The instance of "DAQmx Write" is "Analog 1D Wfm NChan NSamp".
Hope that's clearer!
d
03-11-2010 07:59 PM
Thank you DianeS. That worked perfectly.
Just a note for anyone else who is doing something like this, if your arrays are different sized going into the waveform builder the array combine function that comes afterward will not be able to pad the resulting waveform to match size and you will get error -200103.