LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network streams - multiple windows executables to compact RIO target

Solved!
Go to solution

Hi,

 

I am trying to connect multiple windows executables to a single compact Rio target using network streams (Only one direction; windows executables send data, CRio receives data). This functionality works fine when using stream senders in the dev environment.

 

I have seen that doing this successfully requires the use of a context name in the endpoint url that contains the application name, however I am having trouble figuring out how to do this since all of the examples I have seen deal with multiple (windows) executables attempting to establish streams to other executables in a windows environment. I have attempted to add context names on both sides (executable and Rio) without much success.

 

It works as follows:

 

-A random string is generated, which becomes the reader name of the open endpoint on the CRio.

 

-This random string is written to a shared variable.

 

-A windows VI or executable reads that shared variable to know the open endpoint name on the CRio. It then establishes a connection with the listening endpoint on the Rio. 

 

-The Rio then generates a new random string, which becomes a new open endpoint. This is written to the shared variable and the cycle continues.

 

The problem is that all of this works fine when connecting multiple windows VIs running in the dev environment to a single CRio. Multiple executables on different computers connecting to a single CRio also work fine. Where I get into trouble is trying to run multiple executables on a single computer connecting to the CRio, or an executable and the dev environment connecting to the single CRio.

 

All of the reading I have done points to this having to do with the context name. The context name is "LabVIEW" when running in the dev environment, which works fine. When running executables, it is apparently the application name, and this seems to be the reason it falls over in the end.

 

Can anyone point me to an example of what needs to be done? I have tried a number of things to no avail. I am unsure of the role of the context name in making all of this work.

Download All
0 Kudos
Message 1 of 8
(4,016 Views)

Do you think that you could post the project as a whole? It might help me in understanding the approach you are taking and give suggestions on what to modify what you already have so far.  

 

Danielle

Applications Engineer

0 Kudos
Message 2 of 8
(3,943 Views)

The projects are huge (hundreds of VIs). I have attached the two bits of relevant code.  The RT stream listener runs on a CRio and the testing endpoint connector runs in the windows dev environment or as an executable. 

 

If you could manage to get the testing endpoint connector to connect to the RT stream listener as both an executable and in the dev environment simultaneously that would be great.

 

Thanks

Download All
0 Kudos
Message 3 of 8
(3,939 Views)

I have made a project encapsulating all of the relevant VIs and targets to make it more clear what I am trying to do. If you could manage to modify the code so that it works with both the VI and executable running that would be great.

0 Kudos
Message 4 of 8
(3,925 Views)

Great; that project definitely help! Just to clarify how you know the code is not working? Is an error thrown? How do you check the connection? How do you verify that the endpoint connector is connected to the RT stream listener as both an executable and in the dev environment simultaneously?

 

Danielle

0 Kudos
Message 5 of 8
(3,912 Views)

The RT stream listener is run first, then the testing endpoint VI. If a successful connection is established, the connected boolean from the network stream endpoint property node returns high. If unsuccessful, generally the following error occurs;

 

Error -314350 occurred at Create Network Stream Writer Endpoint in testingendpoints.vi

 

Possible reason(s):

 

LabVIEW:  Another application is already streaming data to an endpoint in the context you specified. If you specified a context name in the reader name or writer name terminal of the endpoint, you must specify an unused context name. If you did not specify a context name, you must specify an unused context name by entering an endpoint URL in the reader name or writer name terminal.

0 Kudos
Message 6 of 8
(3,907 Views)
Solution
Accepted by topic author parsec43
Message 7 of 8
(3,901 Views)

Could you please share me the project , i can have look to have deeper understanding please

0 Kudos
Message 8 of 8
(305 Views)