08-31-2012 05:17 AM
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!
Solved! Go to Solution.
08-31-2012 05:19 AM
my platform is Labview 2012 DS2. I've just updated
08-31-2012 06:40 AM - edited 08-31-2012 06:41 AM
@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
09-03-2012 01:57 AM
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.
09-03-2012 02:23 AM
Can you show us the code as a snippet or a vi?. (LV2009 vesion please)
09-03-2012 03:31 AM
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
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).
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.
09-03-2012 07:22 AM
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
09-03-2012 10:15 AM
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
09-03-2012 02:42 PM
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.
09-04-2012 07:38 AM
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