LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

network stream clear state

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

0 Kudos
Message 1 of 13
(3,607 Views)

Hello, Vitor

 

What kind of communication protocol are you using TCP/IP, FTP?

Guilherme Souza
Applications Engineering
National Instruments Brazil
0 Kudos
Message 2 of 13
(3,559 Views)

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

 

 

0 Kudos
Message 3 of 13
(3,515 Views)

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:

LocalHostNS.png

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 4 of 13
(3,509 Views)

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!

 

0 Kudos
Message 5 of 13
(3,323 Views)

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?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 13
(3,311 Views)

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!

0 Kudos
Message 7 of 13
(3,292 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 13
(3,284 Views)

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.

0 Kudos
Message 9 of 13
(3,271 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 13
(3,257 Views)