06-19-2013 02:35 AM
I have a configuration where I am talking to a unit using UDP messaging the messaging is a command response setup where by the CVI program sends a command and then waits for the response to be returned
The program outline that I have is as follows
Configure UDP write port
Configure UDP read port
Loop
UDPWrite
UDPRead
Do stuff
End loop
Close read port
Close writ port
End program.
For completeness the code is split into a number of functions that reside in the same DLL that is called from Test Stand.
The channel handle for the TX and RX UDP end points are stored in static Global variables.
The code works fine for most of the time but when I have executed the loop a number of times (the number is random some time a few hundred times some time a couple of thousand)
I get an error message either on the write UDP message or on the read from UDP functions
The error is
-6810 |
kUDP_ChannelClosed |
The channel has been disposed |
If I step round to the next UDP command
I get the following error -6800 |
kUDP_InvalidChannel |
I have tried to trap the error and re configure the UDP port but I get the error
-6811 |
kUDP_PortInUse |
So I am unable to trap the error re open the port and continue.
My application requires the program to operate 24/ 7 so if such an error occurs I need to be able to recover.
Test setup is as follows.
Test stand 2012 version 5.0.0.252
CVI 2012 Version 12.0.0.0 (422)
Pc is running windows 7 pro 64 bit
Pc is a Intel core i3 processor.
Program was complied as a 32 bit application.
And is running in debug mode
I have transferred the same application to a windows XP machine and this has continued to execute for over 12hours with out error where the windows 7 machine would not last 1 hour of operation without an error.
06-19-2013 01:29 PM - edited 06-19-2013 01:34 PM
First of all try to add some delay after you open/close the ports. Maybe 500ms could be enough.
As the most of the times it is recommended to open the ports on request and close after the usage, check that you did not make recurrents calls at the same time.
Is a basic but you can start from there.
.
06-19-2013 01:31 PM - edited 06-19-2013 01:34 PM
One more thing, as you are using TestStand, try to lock the step.