LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

errot tcp 57

Solved!
Go to solution

Good morning,

I have the error 57 with tcp connection when I try to read a message. What can cause it?

The strange thing is that the error is repeatable in the same point of the program, in a sub-vi set as reentrant execution. Other blocks use the same tcp connection and they work well. I have another program with the clone of that sub-vi and it work well in the same way.

It sounds very strange!

0 Kudos
Message 1 of 11
(3,593 Views)

my platform is Labview 2012 DS2. I've just updated

0 Kudos
Message 2 of 11
(3,592 Views)

@FabioBone wrote:

[...]. Other blocks use the same tcp connection and they work well.


 

 Probably that's the problem, since the error description is the following:

 

57 The network connection is busy.

 

You'd better use the connection in a single place in your code.

 

Regards,

Marco

0 Kudos
Message 3 of 11
(3,586 Views)

Isn't there any other issue for that kind of error? I'm quite sure that I use the connection only in a block at a time.

0 Kudos
Message 4 of 11
(3,572 Views)

Can you show us the code as a snippet or a vi?. (LV2009 vesion please)

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 11
(3,566 Views)

Hi,

Today i haven't any problem on the connection. The file is not changed. I think the system held some processes those use the tcp connection. I didn't think to watch in the task manager. It is the only explanation that I can pop out. Anyway I put above the program that gave me that problem. Please, check if the application is bad-built and suggest to me an alternative. Thanks

 

Program_Labview.png

 

 

Sub-VI_Labview.png

 

The block linked over is send-receive packet, opened above. In the first frame the block above send a message on the tcp connection, then it waits 1 second, finally it waits for the answer on the same connection (8 seconds).

 

Send_receive_Labview.png

 

receive_the_packet.png

 

The tcp reading block returns error 57. No other request on the same connection is active. I let the timeout of the block to end every 50 ms, I ignore error 56 (timeout) end I terminate the loop execution if:

- a message of a least 5 character is received (application protocol specification).

- the timeout of the receiving block ends (8 seconds)

- a tcp error different from 56 turns out.

0 Kudos
Message 6 of 11
(3,560 Views)

Nevermind, the problem arose again. Please, can you explain all the processes of National Instruments that uses tcp connections in my system? I think two of them use the connection I need (port 49160 and 49158) and a third is the listening connection. The others??  Below the list

currports.png

0 Kudos
Message 7 of 11
(3,551 Views)

It it possibile for you to use different ports, at least for a try?

Is the reentrant vi using the connection called only once (no more than one clone)?

 

I don't see in the screenshots where in the code the connection is closed and reopened.

Is it possible that the local variable storing the connection is not updated properly?

 

Regards,

Marco

 

 

0 Kudos
Message 8 of 11
(3,543 Views)

Given the way your code looks I wouldn't be surprised if you had lots of race conditions. Also, in task manager what are the applications that are listening on the prots you specified. Are those your applicatons or other progams. You can only have one program listening on a given prt at a time. If you are trying to have your LabVIEW listen on the ports that other appications are listening on you will get the error.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 9 of 11
(3,537 Views)
Solution
Accepted by topic author FabioBone

I resolved, I need to pay more attention on the flow of my application. I forgot to present an output of a block to an input of another one and the two blocks was executed in the wrong order, holding the connection at the same way. The connection is correctly initialized and the local variable is updated correctly: I haven't errors at that early point, only in the more complex frame.

Thank you for the answers

0 Kudos
Message 10 of 11
(3,525 Views)