LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP reader in CVI

Solved!
Go to solution

Hello everyone,

 

I need help in writing a small UDP reader and writer in CVI.

I followed the instructions from this post:

 

http://www.ni.com/example/6723/en/

 

The UDP writer example worked. But I could not make the UDP reader example worked. 

It seem that the UDPCallback function (when there is data arrived at the UDP port) was never triggered.

 

Has anyone found a solution for this? 

 

Thanks,

Quan

Download All
0 Kudos
Message 1 of 4
(3,146 Views)
Solution
Accepted by topic author Quan85

Hi Quan85,

 

Can you confirm that UDP datagrams are actually being received on the port?  How are you sending the data to be received by the reader?

 

This is the function used to register the UDPCallback, for your reference: http://zone.ni.com/reference/en-XX/help/370051AG-01/cvi/libref/cvicreateudpchannelconfig/

 

Thanks,

Michael B.
Product Support Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,093 Views)

Thank you for your reply Michael,

 

Today I rewrote the example with the same IP address but different ports (on the same PC). It worked.

May be I made some mistakes in my previous example or I need to recheck the connection again. It might be the LAN connection problem between the two PCs I used to test before.

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

Hello,

the "Writer" Example has an error.

The "destAddr" was not set.

 

I added

errChk (GetCtrlVal(panel, PANEL_ADDR, destAddr));

in Line 53 of UDPWriter.C and it worked.

 

Sincerly

       Torsten

0 Kudos
Message 4 of 4
(2,534 Views)