LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronize Multi-function AI & AO without regeneration signals in DAQmx

Hi,
My case is that I need to change the amplitdue of sine wave which is generated by AO always, say once for 2 loop. Also, I need to synchronize AI and AO to do measurement. I can't find any examples on combination of them. I did try to combine Multi-Function-Synch AI-AO and Non-regeneration.vi . However, it can't work. May any one help me to solve it? Thanks very much.
0 Kudos
Message 1 of 8
(4,399 Views)
Hi taipo,

I suspect the error you encountered was -200288? This is likely due to the fact that you were attempting to write to the buffer beyond the number of points the task was configured to generate (since the task was configured for Finite Generation). Please try the example enclosed.

Thanks,
Lesley
0 Kudos
Message 2 of 8
(4,387 Views)
Hello Lesley,
Thanks for your help. However, it still can't work. Now the error code is 200292. Moreover, I did increase the buffer number. or write "Analog 1D DBL 1 Channel N sample" rather than "waveform"
0 Kudos
Message 3 of 8
(4,377 Views)
Taipo,

I tried running the example with the following parameters:
Buffer Size (for input and output): 1000
Size (Samples): 500

Make sure the number of samples in yout waveform output is smaller than the output buffer you have configured.

Thanks,
Lesley
0 Kudos
Message 4 of 8
(4,359 Views)
Hi Lesley,
I did set buffer size = 1000; samples = 500. error 200293 is shown. How can I do?
0 Kudos
Message 5 of 8
(4,352 Views)
Hi taipo,

What parameters are you running your code with? I set the input and update generate rate to both be 10000, along with the settings indicated above, and did not encounter any problem. Make sure the update rate is not too slow relative to the input rate, or you may not have enough time to write all the samples to the buffer before they're overwritten by the next iteration. Also, what kind of board are you using?

Thanks,
Lesley
0 Kudos
Message 6 of 8
(4,342 Views)
Hi Lesley,
Thanks very mcuh. It did work properly. I am using PXI4461. Now I use 200kHz sampling rate and 100k samples. 1M pts Buffer.
0 Kudos
Message 7 of 8
(4,332 Views)

Hi Lesley,

 

I have been struggling with DAQmx for a while now.  I have a cDAQ 9168 chassis and I am trying to synchronize my analog inputs with my analog outputs.  The analog input card is a NI 9205 and the output card is a NI 9264.  After the example in this thread I think I can get it working.  I have tried to combine regenerative output and analog input and this worked.  Now I was just looking for non regenerative output.  The VI in this thread looks exactly what I need.  Many thanks for that.  

No I am just wondering how I can get to datalog my in and outputs.  I know the input gets its t0 at the first read operation and then every other t0 gets calculated from the number of times the buffer has been read and the sample rate and sample size.  The question is however how do I get a t0 for my outputs?  I guess I could just reuse the t0 from my input no?  since they are synchronized and starting at the same time.  If I use the same rate for in and output I could just build a waveform with t0 from my input and use dt derived from the sample rate correct?

 

Thanks 

 

Lieven

0 Kudos
Message 8 of 8
(3,629 Views)