03-03-2014 07:36 AM
Hello all!
Again I got problem of multichannel siganl generation with NI. This time, I shall generate 2 frequency siganls and 2 current siganls (frequency =0)
with all 4 channels of NI 9265. I'm stuck in the place where the generated siganl are written in the buffer. My code is like this:
I shall use the 2 methods of writer, WriteWaveform and WriteSingleSample, to write the generated frequency signal of 2 channels and current signal of
2 channels to buffer. If I just put them in sequence like this, when running, the program detects only the waveform data, showing the error that the
channles in the data (2 channels) are less than the channels in the task (4 channels).
So I wonder if the solution is to make these 2 method run concurrently. If yes, how could I do that?
Thanks in advance.
Chao
03-07-2014 07:34 AM - edited 03-07-2014 07:46 AM
Hello!!
The problem is probably due to a misconfiguration of the task. Can you post the codes of the task initialization and timing?
You can find useful examples of .net analog output in Daqmx folder (verify if you have installed the example files).
the following document could help you:
http://www.ni.com/white-paper/5489/en/#toc4
Maybe the solution posted on the following thread can help you:
03-07-2014 07:47 AM
Hi Lamber,
Thanks for the reply. Actually after waiting for some time I just gave up this idea to write separately the waveform and DC current amplitude to 4 channels.
Instead, I just used one write.waveform for all the 4 channels, setting 2 of them with 0 frequencies just to pretend that they were DC currents. And that
works!
Anyway after these days I thought this post has long been forgotten, so really appreciate your reply.
I attached my FunctionGenerator.cs here showing what I did. Hope it might be helpful for others!
Chao