LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to activate UDP callbacks in Win 7

Solved!
Go to solution

Hello.  I am sending UDP datagrams from an embedded controller to a PC.  The PC is Win 7 home premium, 64 bit, Core i3, Broadcom NIC and is running CVI2012.  I am using the UDPReader sample code that comes with the Samples provided with CVI.  I have tried everything and can not get the UDPCallback to execute.  The embedded controller successfully creates the socket.  I can see the packets being transmitted by the sender.  I can use Control Panel to view the Local Area Connection and I can see the Received bytes count increasing with every send.  However, the UDPCallback is not called.  I have tried the following:

1) Addressing:  I thought I may have a problem with incorrect IP address or Port numbers.  I have tried numerous combinations and also tried USE_ANY_LOCAL_PORT  and USE_ANY_ADDRESS,  which (as I understand it ) should set up the code to receive a UDP packet from anywhere.

2)  I have tried altering the configuration of the NIC (Broadcom Etherenet adapter on main board ) as I see that many NIC devices can process Checksums and alter the way they interrupt the processor.  I have tried disabling all these NIC features.  No change.

3) I have tried using multicast and broadcast.

4) I have tried packets of different length.

5) I have set breakpoints in the callback but they are not reached.

 

I don't have a network analyser so I can't easily check the content of the datagram arriving at the PC.

I wonder if:

1) My datagram is not properly constructed and is being rejected. ( Should be OK as the embedded controller has a UDP driver which obvously should comply with the protocol.)

2) There is a problem due to having a multi core processor on the PC

3) Some code is required to allow the Win 7 system to flag to CVI that a packet has been received.  The UDPCallback is triggered by the event UDP_DATAREADY and this seems to be related to an event FD_READ but I haven't been able to find further information on it.

 

I CAN successfully Ping the controller from the PC, so there is no underlying issue with the LAN. 

 

Any ideas much appreciated.   Stuart.

0 Kudos
Message 1 of 4
(3,514 Views)
Solution
Accepted by topic author sjr_phoenix

Hi Stuart,

 

Have you disabled your firewall(s). Most of the reports I can find on having problems receiving information through a UDP connection is due to firewalls being enabled on a machine. That includes both Windows and third party firewalls.

 

Regards,

 

James W.
Applications Engineer
National Instruments
Message 2 of 4
(3,494 Views)

Hi SerJames,

Thanks for that - I should have thought of it but because I have it set up as a LAN it didn't occur to me.  Will try it ASAP.  One question that arises.  The plan is to set up the PC with 2 Ethernet adaptors.  The idea is that one will service the LAN for connecting to the embedded controllers and the other will connect to the site WAN to give web access for remote monitoring etc.

I'm sorry that this is a Win question more than a CVI question but is it possible to disable the firewall on the LAN network whilst leaving it enabled on the WAN ?    Alternately, can I set up an exception  in the firewall for the IP addresses I intend to use on the LAN.  I am using an IP range reserved for LAN use,  10.10.6.xxx  with a mask of 255.255.255.0

Thanks again.  Stuart.

0 Kudos
Message 3 of 4
(3,488 Views)

Hi James.  Forget my last post.  I am a late adopter of Win 7 as XP worked so well we stuck with it as long as we could.  I just remembered that Win7 offers separate firewall options for public and local networks.  Will try it and let you know.

Thanks.  Stuart.

0 Kudos
Message 4 of 4
(3,485 Views)