LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can a dangling network stream endpoint be destroyed

I have a cRIO application that creates a network stream writer endpoint that communicates with a windows hosted app that creates a matching network stream reader endpoint.  I have found that on occasion an error in my software occurs and the rt vi that created the writer endpoint stops and the windows app also stops without destroying the endpoint.  The problem is that the rt vi that creates the stream endpoint is called with vi server and exists in the rt startup hierarchy and thus the endpoint name is preserved in memory.  When the process is repeated and the stream is created again the create endpoint vi errors out saying that the stream already exists.  Since the original stream refum is lost, my question is how can one deal with this kind of situation.  Unfortunately the create network stream vi's do not have a option to overwrite any existing endpoints.  I will agree that this sort of thing should not happen in a working application but during debug it is quite frustrating.

0 Kudos
Message 1 of 5
(2,929 Views)

Hey Sachsm,

You will want to set up your program such that in the event of an error your application does not exit immediately so that you can still close your network stream references.  You can do this by wiring the error wire through your program and when you detect an error on it stop your loop, close all references, and then pass the error to an error handler. If you don't close your references before the program exits (either by an error or the Abort button) then you will probably have to close LabVIEW to get the references to close.  Post back if you have any questions on this.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 5
(2,915 Views)

Ok, just wanted to confirm the behavior.  I will make a suggestion to add the ability to reopen a network stream even if the old reference is still valid.

0 Kudos
Message 3 of 5
(2,908 Views)

Hey sachsm,

If you make a product suggestion I will vote for it. I think it would be useful to have a way to overwrite the old reference even just for the cases where you get into trouble with not closing them correctly so you don't have to restart LabVIEW. 

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 4 of 5
(2,906 Views)