LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP close causing error #1

hey

i have written a simple VI to stream data acquired from a DAQ card over a network using UDP packets. it is working fine, but when i terminate the program the UDP Close VI is causing error #1 to occur. does anyone know how i can solve this problem?

i have attached a gif of most of the block diagram.
0 Kudos
Message 1 of 3
(3,704 Views)

Try replacing the tunnels that bring the UDP conncetion reference in and out of the For loop in the bottom loop with a shift register.

If the For loop iterates "zero" times the contents of its output tunnel will be the default value.

That would in turn pass a null refnum to the close.

Trying to help,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 3
(3,699 Views)


@Ben wrote:

Try replacing the tunnels that bring the UDP conncetion reference in and out of the For loop in the bottom loop with a shift register.

If the For loop iterates "zero" times the contents of its output tunnel will be the default value.


Just to clarify what Ben just said:

  1. Using Tunnel (your code): If the FOR loop iteration count is zero, the UDP reference output from the loop is reset to default.
  2. Using Shift register:  If the FOR loop iteration count is zero, the UDP reference is output unchanged from the shift register input and is thus valid.
0 Kudos
Message 3 of 3
(3,694 Views)