Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

A question on USB DAQ 6008

Solved!
Go to solution

Hey all,

I have a simple question. I am trying to generate a sine wave using a waveform generator, send it to analog output and detect the same signal using analog input. However, I am having problems for this. It is giving me an error of: Write cannot be performed, because the number of channels in the data does not match the number of channels in the task. Number of Channels in Task: 2
Number of Channels in Data: 1000

 

I would be happy if any of you guys can help me.

 

Regards,

 

Metcik

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

Hi Metcik

 

I've had a look at your analog output DAQ assistant and it looks like you have created two analog output tasks. So the DAQ Assistant is expecting more data than you are getting from the simulate signal node.

 

Delete one of the tasks in the Analog Out DAQ Assistant.

 

Ingram

Ingram | CLA
0 Kudos
Message 2 of 6
(2,484 Views)

Good morning Metcik!

 

As ingram correctly pointed out there is probably a task too much defined in your DAQ assistant. Simply delete either VoltageOut or VoltageOut_0.

 

But that does not solve all the problems:

1) Your sine will be in the range -1...+1 volts. The analog out can of course only produce positive voltages. Configure your Simulate Signal e.g. to "Amplitude 1" and "Offset 1" to get a sine that is between 0...+2 volts.

2) Your channel is set to "Generation Mode: 1 Sample (On Demand)" in the far bottom of the DAQ Assistant window. But the Signal Generator is set to generate 1000 samples every time. That's the reason for your original error message. Change the Signal Generator to output one signal each time and you are fine.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 3 of 6
(2,462 Views)

Thank you very much for your reply. In bullet point (2) you told me to change the sig gen to output 1 signal per second. However, samples per second must be at least 2 times the frequency that I am using. WHat should I do? 

 

Your help is much appreciated. 

 

Kind regards,

 

Metcik

0 Kudos
Message 4 of 6
(2,457 Views)
Solution
Accepted by topic author metinilke

Oh sorry, I was unprecise.

 

My goal was to make you aware that you need to send one sample (a single data point) to the DAQ Assistant in every loop iteration. There are (at least) two ways to do so: The simple one and the elegant one.

 

Untitled.png1) Simple: Change the number of samples the Simulate Signal VI outputs on every call (without changing the rate of course). Drawback: You still call the Simulate Signal VI every loop iteration. That is, in this case, 10000x per second.

 

2) Split the signal samples from the Simulator and feed them into the DAQ Assistant one by one. See the attached vi file to find out how. Mind the indexing input on the left side of the loop around the DAQ Assistant I inserted.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 5 of 6
(2,451 Views)

Thank you very much. You solved my problem.

 

Kind regards,

 

Metin

0 Kudos
Message 6 of 6
(2,403 Views)