LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Infrequent delays in RTOS DLL execution

Solved!
Go to solution

I've been profiling a program I'm writing that makes multiple DLL calls every 10 ms and which runs for multiple minutes, and I've noticed some strange behavior. In the attached vi.png, you'll see a very pared down VI that's enough to illustrate my issue. Basically, every 10 ms, I make a call to a DLL which has one operation: 'return 0;'. I'm measuring how long this DLL takes to execute in microseconds and pushing this value onto a FIFO. There's another loop that continuously drains this FIFO into a TDMS file. The attached graph.png shows the data from the TDMS file graphed in Excel.

 

The issue I'm having is in that single outlier a little before the 15,000th tick of almost 900 microseconds. The average duration of a call to this simple DLL is about 2 microseconds, yet sometimes it appears to take almost 900 microseconds. In the more complete version of this example, the delays are also almost 900 microseconds. They're infrequent, but I can expect to see roughly one in every 320 second trial (sometimes more, sometimes fewer). It's important that I not see them at all.

 

For what it's worth, I have the VI deployed to an x86 desktop LVRT box, and it executes on startup. I leave it alone for those 320 seconds, then gather the TDMS files from FTP afterwards. Any clue why this might be happening? What's special about 900 microseconds? I've attached the VI as well, and can make the TDMS available in another post if anyone is interested.

Download All
0 Kudos
Message 1 of 3
(2,534 Views)
Solution
Accepted by topic author dgoes

I don't think there's anything necessarily special about your 900us jitter, it just sounds like an SMI is firing periodically causing the system to experience high amounts of Jitter.  On PXI and Desktop systems, jitter spikes in the 850-950us range generally come from the Legacy USB SMI; in the BIOS, disable Legacy USB and see if the jitter goes away.  Occasionally we'll have a BIOS where we disable everything and we still see an SMI fired that causes the system to come to a screeching halt for about 1ms, and we upgrade the BIOS and things go away.  Make sure the BIOS has been updated, and disable Legacy USB.

 

-Danny

Message 2 of 3
(2,525 Views)

It looks (tentatively) like you're right: I'm no longer seeing the jumps to 900 us after a couple of tests with Legacy USB disabled in the BIOS. I'll dial it in for a much longer test to get more confidence in the result, but I think you solved it. Thanks!

0 Kudos
Message 3 of 3
(2,501 Views)