LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Random error occur if a program including Non-regeration AO and Synchronous AO&AI function?

Hi,
Does you know Non-regeneration of data and synchronous AO&AI functions can be written in same VI or not?

I did a program which needs Non-regeneration of Signal and Synchronous AO&AI functions.
When I run this program, a error 200292 is random occured. Would you know how to solve it? Thanks very much.
0 Kudos
Message 1 of 6
(2,987 Views)
Hello,

You should be able to run a synchronous AI/AO in Non-regeneration mode. Try running the attached example. It ran for me without generating any errors.

Regards,
Sean C.
0 Kudos
Message 2 of 6
(2,976 Views)
Hi Sean C.
Thanks very much. I run it. it has a error in my pc. (Error 200290)
What is your initialize setting in the program?
0 Kudos
Message 3 of 6
(2,963 Views)
Hello,

I updated the default values for the controls on the front panel. Try running the VI with these values. I believe the 200290 error was occurring because the DAQmx Read would hold the while loop until the "Number of Samples to Read" had been acquired. By changing this parameter to -1, you are telling the function to read whatever data is in the buffer. This allows the loop to iterate as fast as necessary to prevent regeneration of AO data.

Let me know if you have any further questions.

Regards,
Sean C.
0 Kudos
Message 4 of 6
(2,953 Views)
Hi Sean C.
Thanks. I still have 2 problems on this program.

1. If no. of sample is -1, then I can't control how many points it capture. I cannot do the alignment between AO and AI data. For example, AO is 100kpts and AI is 90~120kpts.

2. If the "Sinewave generation" is run before AO write, the level or frequency AO signal cannot be changed during program running. However, I need it to be changed easiy and effectively.
0 Kudos
Message 5 of 6
(2,951 Views)
Hello,

"1. If no. of sample is -1, then I can't control how many points it capture. I cannot do the alignment between AO and AI data. For example, AO is 100kpts and AI is 90~120kpts."

Even though you are displaying 90 - 120 kpts per iteration of your while loop, the AI and AO is still synchronized. The reason you are seeing a difference in the number of points written and read in each loop is because the DAQmx Read.vi immediately reads whatever data is in the buffer. Then the DAQmx Write.vi writes 1000 points. The DAQmx Write will hold the loop until all 1000 points are written. When the next DAQmx Read is called, it picks up the data that it missed in the previous iteration plus the new that data that was written.


"2. If the "Sinewave generation" is run before AO write, the level or frequency AO signal cannot be changed during program running. However, I need it to be changed easy and effectively."

To change the waveform parameters during execution, you just need to put another waveform generator inside the while loop. I have made this modification and attached the new VI. Keep in mind that with AO, the output frequency is dependent on the frequency control, sampling frequency of the generator, and update rate. Use this formula to calculate actual output signal frequency:
Output Frequency = [Update Rate * Frequency] / Sampling Frequency

Let me know if you have any further questions.

Regards,
Sean C.
0 Kudos
Message 6 of 6
(2,929 Views)