LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling rate and number of samples

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.

0 Kudos
Message 1 of 6
(869 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(867 Views)

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.

0 Kudos
Message 3 of 6
(853 Views)

Hi crowley,

 

your code also was created with LV2022+ which I don't have available.

Mind to "Save for previous" for LV2019 and re-attach?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(837 Views)

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.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 5 of 6
(815 Views)

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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 Kudos
Message 6 of 6
(795 Views)