08-29-2012 12:01 PM
Hi there,
I`m having a strange problem with the network stream. I`m using the LabView 2011 with Windows XP.
I have a project that uses a network stream for some data, not really special The connection is only for localhost on . But some times, the network stream don`t initialize, returning the following error:
Another application is already streaming data to an endpoint in the context you specified.
Ok. I just close the application and run again, but not works again. And here is the problem: I close the LabView completely, open it again and the error is there. Just restarting the computer and running the labview and the same application, and it works fine.
I would like to know how can I clear the connection that stills somehow activated, even the labview is closed ? What is that ghost connection that remain and maybe how can I clear that or even close the process that is responsible for that ?
If closing the LabView the connection was destroyed, I would not be having this question, so fix the project architecture for not having errors will not fix the problem of some times it occurs.
Thats for any help,
Vitor
09-03-2012 01:40 PM
09-05-2012 02:56 PM
Hi Guilherme,
Thanks for the feedback.
There is just a default Network Stream project, that simple stream some data to localhost, using the default VIs for this, I think with TCP. The only special thing is a global variable that keeps the reference of the connection.
What is worring me is that some times, when the connection throws an error, even closing the labview I just can`t clear the connection (but there is no application running). I think some data is being lost at the national background running applications and only restarting the computer we can run the program again.
Would be global variable fault for this strange behavior after closing all app ?
Thanks again,
Vitor
09-06-2012 12:59 AM
From what I understand, you are creating the reader and writer endpoints on the same host. Are you using the "Destroy Stream Endpoint" to close the writer endpoint of the localhost? If you are destroying the writer endpoint and still facing this issue, post your code here so that we could debug it.
A quick example, replace the reference in the second while loop by local variable of stop button:
07-22-2014 12:11 PM
Hi
Have you solved the problem? I guess i am having the same one too. I have attached a screenshot, please someone help to have a check? Cheers!
07-22-2014 12:37 PM
That error typically happens when you try to open two endpoints with the same name or you don't close your streams properly. Can you attach your actual code?
07-23-2014 03:42 AM
Hi Crossrulz,
Many thanks for replying and sorry for this delay. Honestly, the actual code is just my try to test whether I understand and use the network stream propoerly. I have attached it and please have a check. Thank you!
07-23-2014 06:38 AM
On your Reader, do not wire up the URL. Since you put something there, it will try to connect, but will fail and give you an error.
On your writer, I would get rid of the ":Untitled 4.vi" part of the URL. There are not multiple applications running on your sbRIO, so that isn't needed. So your URL should be "//169.254.202.225/dataReader".
And as a side note, you don't need the wait in the reading loop. Your loop will sleep while waiting for data to come down the stream, so that should limit your loop rate.
07-24-2014 04:34 AM
Many Thanks for replying.
However, I have tried to change the code as you suggested but it still pops up the same error. I run the RT first then run the writer. Is this order correct?
Thank you.
07-24-2014 07:00 AM
The order in which you start the VIs shouldn't matter. How are you stopping the VIs? In the code you gave me, you weren't stopping the loops. That could cause issues since the streams were not closed.