07-04-2019 07:08 AM
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
Solved! Go to Solution.
07-08-2019 06:34 PM
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,
07-10-2019 12:48 PM
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.
08-25-2020 11:29 AM
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