LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Rate Changing, On Demand to 1kHz

We had a contract programmer setup a data acquisition program with sampling "On demand".  As expected, the acquisition is then  software-timed based on the performance of the loop.  Right now this is working out to about 1 sample for 1.2s.  The data is very coarse and no averaging has been implemented.
 
I'd like to reconfigure the sampling to 1kHz, and then calculateto the equivalent of 100 Hz (10 samples average),10 Hz (100 samples averaged), or 1 Hz (1000 samples averaged).
 
If the code (spaghetti, not structured) is set up for sample on demand, is making this fix straight-forward, or am I looking at rewriting.  If it matters, we are collecting about 20 channels of information.
 
Thanks for any thoughts
0 Kudos
Message 1 of 2
(2,496 Views)
Jeff,

this mainly depends on the "grade of spaghetti" according to the complexity of the application.
The worst case would be bad programming style (normally understood as "spaghetti code") with bad algorithms (Rube Goldberg or even faulty ones everywhere) and the whole application in a single loop.
If you run into a worst case scenario, rewriting would be propably the best.
If spaghetti is the only drawback, everything else is good in the application (good modularization, good architecture itself), you will just refactor the part you are going to change and then implement the new feature.


From your statement regarding the current performance, i asume you are seeing something more like "worst case". Nevertheless, you can give refactoring a try. Just try to exclude the dataacquisition from the rest of the application. If this can be done in a justifiable time, you can change the application without rewrite.

hope this helps,
Norbert B.
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 2
(2,492 Views)