01-21-2014 07:44 AM
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
Solved! Go to Solution.
01-22-2014 10:12 AM - edited 01-22-2014 10:14 AM
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
01-27-2014 02:18 AM
This fixed it for me 🙂
Thanks alot