02-01-2016 09:43 PM
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!
02-01-2016 10:23 PM
Attach your VI so we can see what you tried. Some way or another, you don't have enough waveforms in your data.
02-01-2016 10:31 PM - edited 02-01-2016 10:33 PM
Hello, please see my vi. Actually I just change the setting in the front pannel... How to change the number of channels in Data?
02-01-2016 11:01 PM - edited 02-01-2016 11:03 PM
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.
02-01-2016 11:24 PM - edited 02-01-2016 11:52 PM
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.
02-02-2016 12:45 AM
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 😉