LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Error 66

I have two machines running labview, one is sending and one is receiving via udp. They both work well, however as soon as I stop the vi on the receiving machine I get error 66 "the network connection was closed by the peer" on the sending machine. It taws my understanding that UDP doesn’t do error checking, so I shouldn’t be getting this error. Any thoughts? Attached is my udp programs, the server file takes in UDP data from another computer and sends it to the long ez data display.

0 Kudos
Message 1 of 4
(5,146 Views)
here is the server file
0 Kudos
Message 2 of 4
(5,145 Views)
0 Kudos
Message 3 of 4
(5,144 Views)

Something just doesn't look right in your server app.  You are opening a single UDP connection, but reading and writing data to the same connection from within the loop.  In general, UDP is one directional.  One part sends, another part receives.  Yet you have the server reading, then writing on the same UDP port reference wire.

I'd suggest taking a closer look again at the UDP example programs.

Be careful with your programming style.  In your receiver program, you have the UDP close connection which is actually wired outside of the loop laying on top of the loop as shown by the shadows.  That makes it really hard to read what is going on in the program.  Also, you have numerous places where wires run backwards.  The data on the wires should always flow from left to right and top to bottom.  As you have it, it is difficult to tell what wires are inputs to different functions and which are outputs.  Many of the structures seem duplicated and could probably be placed into subVI's.

0 Kudos
Message 4 of 4
(5,130 Views)