From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to read from a Network Stream in C#

I am writing data to a Network Stream in LabVIEW.  But I must (for various reasons) read the streamed data on a separate computer using Measurement Studio (I'm writing in C#). 

If I did the whole thing in LabVIEW, I would only specify the read url - I don't have to specify the write url. 

This leaves me confused about what to do for the reader in C#. 

A Network Stream in .NET seems to require that I specify an IP address. 

Clearly I'm confused.  Any help would be much appreciated.

0 Kudos
Message 1 of 5
(1,617 Views)

Just to clarify, are you talking about doing something like this, except in C#?

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

Thanks for the reference to an interesting article. 

I think the answer to your question is yes --- I'm not completely sure, because I'd have to first read the article (which I intend to do).

The central problem I'm facing is that I create a Network Stream Writer End Point and provide it with a reader url (in the form \\target-computer-name\Endpoint-name).  This all works well in LabVIEW.  But when I have the equivalent of the Reader End Point in C#, I have to specify an ip address (not a problem), but I also have to specify a Port Number.  What is the Port Number LabVIEW calls out when I give the Reader Endpoint a name in LabVIEW?  

0 Kudos
Message 3 of 5
(1,589 Views)

After reading the article you referenced, I think I may have to accept using LabVIEW on the read end. 

But I still need to have access to the data obtained in this read from my C# application using Measurement Studio. 

To this end, is it possible to convert the LabVIEW reader application into a COM component I can interrogate from C#?  It doesn't have to be COM - basically anything that lets me grab the data read by the LabVIEW application (hopefully without have to write to file and read from file).

0 Kudos
Message 4 of 5
(1,584 Views)

I found some resources that seem to say use port 2343. Here is document I found most useful. I would look under the Shared Variables and Network Streams section. I also found this, and this, that seem to say similar things. Hope this helps!

 

 

0 Kudos
Message 5 of 5
(1,574 Views)