LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my DAQ program "stutter" in Windows, not in Linux?

I wrote a fairly large program for data acquisition in Labview 8.0 for Linux (I have an NI-PCI-6259 M-series DAQ board). With my SUSE Linux OS, it runs fine collecting data at 44.1 kHz. I'm now trying to run it on the evaluation version of Labview 8.2 for Windows, on Windows XP. When I run it at anything above about 200 Hz, it repeatedly "stutters," i.e. the trace of the input waveform on the chart abruptly disappears and the trace restarts from the right side again. Does this mean that the program is running too slowly on Linux to handle higher sampling rates? In the Linux version, it would give me an error message about attempting to read samples that are no longer available if the program couldn't keep up. But on Windows, there's no error message; just stuttering.

Thanks,
Bill

0 Kudos
Message 1 of 16
(4,349 Views)

Bill,

Provided there is proper error handling, Windows will also throw an error if you are getting a buffer underflow. Here is a KB which shows error codes for buffer underflow and overflow.

 

Does the same “stutter” happen with the examples which ship with LabVIEW? (Help » Find Examples… » Hardware Input and Output » DAQmx » Analog Measurement » Voltage ) How many samples are you acquiring, and at what rate? I would also like to ask for you to post a picture of this ‘stutter’.

David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 16
(4,317 Views)
Okay, I think it's not the whole program that's stuttering, but something to do with the Waveform Chart. If I run the example vi, Cont Acq&Graph Voltage-Int Clk, it looks fine even at a sample rate of 44100 Hz. Then I replace the "Measurement" waveform output with a Waveform Chart, and the output appears to stutter as in my program. In strip chart mode, this means that the waveform advances normally from right to left for a short period of time, then disappears and begins on the right again, moving right to left. Sometimes a little bit of the waveform remains somewhere in the middle of the screen, and continues moving from right to left. Doc1.doc, attached, contains a screen capture of this. The stutter just occured, and the waveform is beginning to move from right to left again, starting from the right side. The white line in the middle is all that remains of an earlier waveform. In sweep chart mode (Doc2.doc), the waveform disappears but then continues moving from left to right from where it was.
 
Thanks,
Bill
0 Kudos
Message 3 of 16
(4,296 Views)
0 Kudos
Message 4 of 16
(4,295 Views)
Bill,

I brought up the example you ran, and changed the graph to a chart, but could not reproduce the problem that you are seeing in your pictures. Can you please post the code of the altered example VI? What is your 'chart history length'? Any other chart properties you may have changed that I can use to try and reproduce what you are seeing?
David L.
Systems Engineering
National Instruments
0 Kudos
Message 5 of 16
(4,273 Views)
Here is the code. I reproduced the problem again from scratch. The chart history length is 1024, but it still happens when I set it to 10000 or 100. I changed the x and y scales, but the problem happens before I change anything on the chart. If I include both the chart and the regular plot window at the same time, only the chart shows the problem. The other one looks perfectly normal. The problem is worst with a higher sample rate (I use 44100 Hz). This is a recently installed version of Windows XP.
 
Many thanks,
Bill
0 Kudos
Message 6 of 16
(4,266 Views)
Okay, here's one other observation that really gets at the nature of the problem: If I drag ANY window around while this vi is running, the trace on the chart stays confined to the right edge and barely has a chance to move -- an extreme form of the stuttering. Then I stop moving the window, and the trace has a chance to move further before resetting. What could cause this? Something to do with graphics or memory?
 
Bill
0 Kudos
Message 7 of 16
(4,257 Views)
Bill,

Running your program, changing the graph to a chart, and moving a separate window around still does not allow me to reproduce your problem. What were the specifications (RAM, CPU speed, hard disk size, etc) of your Linux machine? What are the specifications of your windows computer? The LabVIEW 8.2 Release Notes give the recommended specifications.
David L.
Systems Engineering
National Instruments
0 Kudos
Message 8 of 16
(4,239 Views)
Problem solved -- by updating the driver for my video card.
 
Thanks,
Bill
0 Kudos
Message 9 of 16
(4,224 Views)
Correction: That wasn't the problem. It appeared to be solved just because updating the driver required restart. Things seem to be fine as long as the LabVIEW program is the first and only thing I run (though I don't know if this lasts indefinitely). Then after I've run some other programs -- Explorer, etc., and start LabVIEW again, it stutters again.
 
The only thing that seems to solve this is setting the Base Priority of LabVIEW to "Realtime." Basically, it looks like other processes are competing with LabVIEW and causing this problem. Especially csrss.exe.
 
- Is there any way to automatically give LabVIEW the highest priority? Or any other way to resolve this so I don't have to think about it?
 
My Windows machine has these properties:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2
Dual Core AMD Opteron(tm)
Processor 170
2.01 GHz, 2.00 GB of RAM
Physical Address Extension
 
Also, there is a software RAID set up on it.
 
Thanks,
Bill
 
 
 
0 Kudos
Message 10 of 16
(4,220 Views)