ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
10-11-2013 04:38 AM
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
Solved! Go to Solution.
10-15-2013 03:38 AM
Hello Serikah,
would you please post your SubVIs SetAnlOut.vi and MeasureAnalVoltage.vi)? Thank you.
Best regards,
Cem Yalcin
National Instruments
Applications Engineering
10-15-2013 03:53 AM
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!
10-15-2013 07:13 AM
Hallo Yalcin,
Below the misseds VIs
Thanks
10-16-2013 06:40 AM
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
10-17-2013 07:42 AM
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
10-23-2013 06:35 AM
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