LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I generate multiple analog outputs on the same board, One signal a square wave the other a constant DC voltage

Hi Blokk, thanks for your help! I did try the first setting, but when I wento the "Waveform settings" part, it grayed out and couldn't work even I chose other options (I mean before increased the index). I got this error:

"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: 2
Number of Channels in Data: 1

Task Name: _unnamedTask<134>"

 

How can I solve this problem?

 

Thanks a lot!

0 Kudos
Message 11 of 16
(972 Views)

Attach your VI so we can see what you tried.  Some way or another, you don't have enough waveforms in your data.

0 Kudos
Message 12 of 16
(958 Views)

Hello, please see my vi. Actually I just change the setting in the front pannel... How to change the number of channels in Data?

 

Picture1.png

 

0 Kudos
Message 13 of 16
(952 Views)

No.  Attach the actual VI, not a screenshot.  That is too small to read.  And the very first part of it is cutoff.  That is important because that is where the task is first defined.

 

Actually, I do see the problem.  You didn't fill in any data for element 1 of the array of clusters called "output array".   As a result, the inner for loop only runs one time which means only one set of data is generated.

0 Kudos
Message 14 of 16
(929 Views)

It is the same vi that Blokk showed. It is the NI sample vi, Voltage(non-regeneration). I didn't change the code.

Now I figured it out... I had to click the gray region, and changed it from sine wave to another waveform, e.g. Triangle Wave. Then there was not gray any more and I can even select the sine waveform back, as well as the Frequency and Amplitude.

Thanks everyone for the help.

0 Kudos
Message 15 of 16
(909 Views)

After this is done, go to the "Waveform settings" part, and click on the little up arrow on the Index display of the array. You will see this is grayed out, meaning the array by default is set to have only one element (Sine Wave by default). Set something else to test how it works, for example chose the Triangle Wave option. You can also play with frequencies/amplitudes...

Note here the description: "The number of elements in the waveform array must equal the number of channels in the task." Obviously...

 

You see, It is useful if you read the entire post, and not only checking the picture 😉

0 Kudos
Message 16 of 16
(884 Views)