LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close connection ID TCP

I'm trying to create a communication client/server. I have achieved to establish the communication and to send messages between clients and server (like a "chat"). 1. My problem arise when I need close the program server. When I stop the VI it doesn't stop (I think the problem is in LOOP1). 2. In LOOP 2 of server I need a wait to run it slowly...why? TCP read timeout doesn't work? Thanks
0 Kudos
Message 1 of 10
(3,295 Views)

Hi vicens,

it sounds like the vi hangs in the TCP listener. You can close the Listener Refnum to stop the the listener waiting on new connections.

 

If this doesn't help, then please show us your vi.

 

Mike

0 Kudos
Message 2 of 10
(3,291 Views)
I forgot to attach VI! Vicen
0 Kudos
Message 3 of 10
(3,284 Views)

this is the vi

 

 

Vicen

0 Kudos
Message 4 of 10
(3,282 Views)

Hi Vicen,

it should work if you move the function to close the listener into the 3rd loop.

 

See the attached picture.

 

Mike

Message 5 of 10
(3,275 Views)

Thank you MikeS8,

 

The VI can to close it, but it occurs Error 1.

Is not important error?

0 Kudos
Message 6 of 10
(3,255 Views)

Hi vicens,

where did you get this error? Can you upload your changed vi?

 

Mike

0 Kudos
Message 7 of 10
(3,239 Views)

The vi changed runs good, but when I stop the program occurs Error 1 in loop1.

 

Vicens

WinXP LV7.1/10

0 Kudos
Message 8 of 10
(3,236 Views)

Hi vicens,

the error is correct, because if you close the listener (what you do in loop 3), then the listener will result with an error and the output is "not a refnum", so you can't read data with the "read function". You can avoid it, if you check which error occurs from the listener and react on it. If you get an error, then you don't need to run the read funtion.

 

Mike

Message 9 of 10
(3,233 Views)
Ok Thank you very much. Vicens
0 Kudos
Message 10 of 10
(3,231 Views)