ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel Loop min update time/ Capacitance Meter with NI-cDAQ-9172

Solved!
Go to solution

Hallo Forum,

 

For demonstration propose I build a simple LabVIEW Capacitance Meter with an NI-cDAQ-9172 / NI-9201 / NI-9263.

The Idea is simple: 

1-)  I charge the capacitor and at the same time I start measuring the time and the razing voltage.

2-) By 63,2% of the charging Voltage, I stop the time a divise  Time[Sec]/Resistor[Ohm] to get the capacity since [Tau = R*C]   

Now my Questions:

-          I have the feeling my Timer function is VERY inaccurate

-          NI-cDAQ-9172 need at least >10ms to set the 5V and about >65ms to read a single value

-          This cause my charging time to not be accurate.

-          Then I change the reading Loop to run parallel to the existing app. Then I compare the iteration and the reading Loop only get run only until the Calculation Loop start. Then it stop running and the measure time is not update anymore. This phenomenon occurs sporadically!!

Can anyone help me how to get a very accurate time out of LabVIEW running on Windows? With my Oscilloscope the time mus be by microseconds…

Thanks

CapMater

0 Kudos
Message 1 of 7
(4,182 Views)

Hello Serikah,

 

would you please post your SubVIs SetAnlOut.vi and MeasureAnalVoltage.vi)? Thank you.

 

Best regards,

 

Cem Yalcin

National Instruments

Applications Engineering

 

 

0 Kudos
Message 2 of 7
(4,125 Views)

Hi Serikah,

 

you should use simple DAQmx functions instead of ExpressVIs and you should set a suitable sample rate, continuous reading and read more than one sample at once.

 

It's not the cDAQ that is slow, it's the ExpressVI combined with reading just one sample that makes it slow!

Best regards,
GerdW


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

Hallo Yalcin,

 

Below the misseds VIs

 

Thanks

0 Kudos
Message 4 of 7
(4,116 Views)

Hello Serikah,

the Timer function works fine. The time issue is caused by your SubVIs. Try to avoid putting a While-Loop over the DAQmx session. Then you don't have to use so many TRUE/FALSE - Case Structures, which costs a lot of time as you described. I'll put you an example how to create, stop and delete a DAQmx session.
Another tip, try to use local variables (right-click on Control or Indicator >> Create >> Local Variable) instead of property nodes as you can see in Main_local_variable.vi

Best regards


Cem Yalcin

National Instruments

Download All
0 Kudos
Message 5 of 7
(4,096 Views)

Thank you Yalcin,

 

Your davice help to emprove the performance and I get close to my expectation.

Still, the CapeMeter get accurate only be hight capacitence or very low charging corrent.

This is do to the timer since I cant do measurement in microseconde range.

I may need an FPGA for this porpose because I really dont know how to get such a "small" time out of Windows.

 

Thanks for your Help

Best regards

Serikah

0 Kudos
Message 6 of 7
(4,086 Views)
Solution
Accepted by topic author Serikah

Hello Serikah,

did you replace the Express-VIs (DAQ-Assistant) with one DAQmx-Session to set voltage and one session to read out voltage?

I suggest redesigning your VI:

           1. don't use parallel while-loop (see attached VI)

           2. don't use Express-VIs

           3. use state-machine instead Sequence-Structure.

 

               --> Tutorial - State Machine:

                    http://www.ni.com/white-paper/7595/en

 

               --> Exercise - State Machine:

             http://www.ni.com/white-paper/7604/en

 

Good luck and best regards,

 

Cem Yalcin

National Instruments

 

0 Kudos
Message 7 of 7
(4,061 Views)