From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL execution speed

Solved!
Go to solution

Hello,

 

i want to transmit UDP Packets in my sequence by calling a .NET dll. Basically the C# code looks like this:

 

public void sendMessages()
{
     while((message = messageHandler.GetNextMessageToSend()) != null){
             sendBytes(message.SendMessage);
             Thread.Sleep(30);

     }
}

 

When calling the function from inside a .NET application, i can see, that each message is sent every 30 milliseconds as expected. 

However when i execute the function from within TestStand there sometimes occur delays (20 - 60 ms) between the sent messages.

Do you know what's the reason for the delays? 

I'm using TestStand 2013.

 

Thank you

Bruno

0 Kudos
Message 1 of 3
(3,998 Views)
Solution
Accepted by topic author 8o34bru

Could be .NET garbage collection. By default TestStand forces garbage collection every 3 seconds. You can disable this if you like with the API Engine.DotNetGarbageCollectionInterval = 0 (You can do this from a statement step sometime at the beginning of your code). Please let us know if this works. Keep in mind though that even if this helps, Windows, not being a real-time OS, there is no guarantee that there won't be hiccups in your execution time due to other code running on the machine using up CPU and other resources.

 

Hope this helps,

-Doug

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

This fixed it for me 🙂

Thanks alot

0 Kudos
Message 3 of 3
(3,932 Views)