LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP comms on windows 7 compatability

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.

 

 

 

0 Kudos
Message 1 of 3
(3,284 Views)

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.

 

.

------------------------------------------------------
There is "No C" in spanish.
If you can think it, you can develop it.
0 Kudos
Message 2 of 3
(3,266 Views)

One more thing, as you are using TestStand, try to lock the step.

 

 

------------------------------------------------------
There is "No C" in spanish.
If you can think it, you can develop it.
0 Kudos
Message 3 of 3
(3,265 Views)