From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow response from DAQ

Solved!
Go to solution

My DAQ system includes RTD temperature measurement via a NI9219 module.  The usual analog in (NI9201), analog out (NI9264), digital in, digital out (NI9401) work fine and run adequately with a single software timed while loop at 20 msec per iteration.  When I add the temperature inputs the loop slows down to the 2 Hz rate of the NI9219 - fine for the temperature measurements but too slow for the user interface and the rest of the system.  How can I keep the loop running and only update the temperature data when the NI9219 finishes?

0 Kudos
Message 1 of 7
(3,113 Views)

Use a case structure so that you read the temperature every 25 iterations.

 

I would recommend keeping the count in a shift register.  Each iteration increment and use the Quotient & Remainder to get the remainder of the iteration number and 25.  When the result is 0, read the temperature.  Put the remainder into the shift register.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(3,111 Views)

Thanks for the quick reply.  It will take me a bit to implement the case structure and I don't think it will work.  The problem, as I understand it, is that LabVIEW blocks other conversions and updates while the NI9219 performs a conversion. What I believe I will see with your suggestion is half a second of updates followed by a frozen half a second while the NI9219 does it's thing.  Is that what you were expecting?  If so, it is no more acceptable than updating everybody at the NI9219 rate.

 

What I think I need is some way to start a NI9219 conversion.  Continue LabVIEW processing, polling the NI9219 for conversion complete.  Upon completion collect data and start over. Unfortunately, I don't see the tools to do that.

0 Kudos
Message 3 of 7
(3,105 Views)

How are your tasks setup?  If you are doing continuous aquisition, then it will be constantly getting the data at a given rate in the hardware.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 7
(3,101 Views)

I do not know anything about the NI 9219 but it sounds like you should look at a parallel loop for the slow acquistion. Something adapted from the Producer/Consumer (Data) Design Pattern should work. You might need three or more loops so that all your hardware tasks are isolated from the data analysis and GUI.

 

Lynn

0 Kudos
Message 5 of 7
(3,099 Views)
Solution
Accepted by topic author Indiana_Bill

Thanks to both of you for your help.  Lynn, your response put me on the right track but I don't need the Consumer/Response Design.  What I needed is three while loops.  One for the slow sensors (NI9219), one for the fast sensors and user interface, and a third around both.  Now LabVIEW starts the slow acquission and then lets the faster acquission run.  I still have a lot of clean up to do but that is the easy part.

 

Again, thank you both.

 

Bill

0 Kudos
Message 6 of 7
(3,084 Views)
You should really look into decoupling your UI from your data acquisition. It won't matter how much optimization you get done, if your UI waits on any acquisition, it will always become problematic eventually.
0 Kudos
Message 7 of 7
(3,047 Views)