Problem Description :
Labview has been programmed to display data acquired from transducers through
the DAQ every second and save every minute (the sampling
rate from the producer loop is set to 1 Hz, which corresponds to 1 sample per
channel per second.). It had been performing this
successfully for several weeks prior to this occurrence. Since the occurrence,
which happened overnight when nothing had been changed in system operation, the
Labview display updates every 10 seconds and saves every 10 minutes. In
addition to this, the data that is being displayed and saved on these intervals
are not consistent with the real time operation of the experimental set up.
There seems to be a lag or disconnect between real data and that which is being
displayed, as it is completely incorrect and at least 10 minutes behind.
Labview specialist response:
As I mentioned on the phone based off the info I have, I believe that the producer loop is essentially running too slow to keep up with the hardware.
More specifically, in the producer loop the DAQmx Analog read Vis are set to read a single sample from the DAQ card's buffer on each iteration. This will work as long as the loop is faster than one second. However, if it begins to run slower than one second, it won't be able to catch up to the buffer. This could be fixed by setting the reads to Read in N samples, which reads the entire buffer by default. That will require some changes to the rest of the code, however.
Additionally, the consumer's rate is always a multiple of the producer loop. You could overcome that restriction by using time stamps to check if a minute has passed rather than check the items in the queue.
As for why the loop is running slower, it's difficult to say without further testing, but it could other programs running on the computer taking higher priority. There might also be a memory leak. You check this by watching the windows performance monitor as the program runs.
Finally I'd recommend benchmarking the producer loop speed and using VI analyzer to search for areas that could be improved. You can access VI analyzer under tools>>VI Analyzer. Here's a forum post with an example code snippet for benchmarking code:
[login to view URL]
As I mentioned on the phone, all of these steps will take some time and effort to get through. Since you haven't been working with the hardware for very long, I could recommend you for NSCS to have an applications engineer available to help you determine the best architecture. If you decide that it would best to find someone to code it for you. I can get you in contact with one of our sales engineers to talk about options in that direction.
10 freelancers are bidding on average $251 for this job
Hello, I am CLD certified Labview developer with over 10 years experience in tests automation. I have required experience to complete this task. Just let me know if you interested. Nicolae