07-17-2019 07:23 AM
I want to monitorize 7 parameters with a step time of 1 second. The data are read and registered in a text file after the execution of the loop.
The problem is that the execution time of the loop exceeds the time period set in the timed loop structurre, so data are saved with an step time of 2 seconds.
I think the problem is in the code. Could anyone help me with this issue?
PD: I'm using the drivers associated with the datalogger Agilent 34970
Thanks
Solved! Go to Solution.
07-17-2019
08:16 AM
- last edited on
05-12-2025
04:55 PM
by
Content Cleaner
1. Set up a scan on the 34970 before the loop. Then you can do all of the reads at once and then do the math needed on each channel. This would eliminate most of your communications (which are slow) inside of the loop. You can look at the example at <LabVIEW>\instr.lib\Agilent 34970\Examples\Agilent 34970 Advanced Scan.vi to see how this works.
2. Do NOT use a timed loop. It is adding overhead you do not need and eliminates a lot of possible optimizations very little gain. Just use a simple While loop and use a Wait anywhere in the loop to set your loop rate.
3. You might want to consider using a Producer/Consumer for your logging. The idea here is to use a Queue to send your data to another loop that logs the data on the fly. This would eliminate the building of a potentially large array for logging at the end.