07-12-2023 05:47 AM
Hello,
I am doing some work on high-speed and high-precision voltage output with PCI 6353 DAQ.But I cant control the voltage output accurately,not even close.My question is if my sampling rate is set at 10khz,and numble of samples is set at 20k,the duration is supposed to be 2s(in my opinion,the working time is equal to the number of sampling points divided by the sampling frequency) or even longer ,why does it only takes about 0.2s to finish the output of voltage?Could someone explain what's happened here? And how can I control the time accurately?
Thank you very much.
07-12-2023 05:51 AM
Hi crowley,
@crowley1234ddd wrote:
why does it only takes about 0.2s to finish the output of voltage?Could someone explain what's happened here?
Nobody can explain the behaviour of your code because you failed in providing that code to us!
@crowley1234ddd wrote:
And how can I control the time accurately?
Did you try to start with the DAQmx example VIs coming with LabVIEW?
07-12-2023 06:24 AM
Hi,GerdW!
Sorry,my code was full of none English words and useless controls,i am trying to do some translation and make it more brief.And yes,my code is based on an DAQmx
example.
07-12-2023 07:17 AM
07-12-2023 08:06 AM
why does it only takes about 0.2s to finish the output of voltage?
How did you know that the output of voltage only takes 0.2s?
Did you check the execution time of DAQmx Write VI? The data are written to the hardware buffer then output through the DAC gradually. It might only take 0.2s for the program to write the data to the hardware buffer but the actual outputting of the waveform might take the full 2 seconds.
If you are checking the time from the analog input, your AI task has a much higher sampling rate at 800k vs AO sampling rate at 100k.
07-12-2023 09:30 AM - edited 07-12-2023 09:31 AM
I personally would not place a bunch of code in an event structure. Look up different architecture such consumer producer loop, QMH, but I completely understand why you have an event structure. I tried to modify your code to this below. The VI is broken because I'm missing subVIs. Hopefully, it will work. Give it a try and let us know.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Colossians 3:17 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~