LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network stream not connecting the host and RT traget.

Solved!
Go to solution

I have a RT target which is connected through a switch to the router, to which my computer is connected. I am running a labview code in the RT Target and my computer, and I am right now using Share Network variables to communicated between these two. But I am loosing data very often, so I am planning to move to Network Streams. But for some reasons I am not able to connect with the RT. I tried multiple sample codes including the ones provided by the labview, but no use.

Please somebody suggest what could be wrong. I am adding a sample code that I tried here

 

Thanks

Sankar

0 Kudos
Message 1 of 4
(2,244 Views)

A while ago, I answered a similar question (for a similar situation) here .  See if this information is relevant to your situation.  If you are still having problems, attach the VIs (no pictures, please) showing the code you are using to create the Network Stream Reader(s) and Writer(s).  There are fairly specific rules for doing this (you can find out "how to" by using LabVIEW Help).

 

Bob Schor

0 Kudos
Message 2 of 4
(2,210 Views)

Looking at your image, I'd suggest that you do the following:

  1. Add some waits to both loops
  2. Check for the timeout case in the Reader particularly (I suspect you might in some situations get timeout on the writer too with your settings, and will depending on the wait durations, but you can experiment with that and see how they work)
  3. Only update the reader's indicator if timeout is false (otherwise you're writing the empty array of all the available elements immediately after you receive a block of 4 elements, which is I suspect what you're seeing).

Note that if you set a specific number of elements to read, you won't have this timeout behaviour (read the Detailed Help for the Read Multiple node to get more details, but basically having the default -1 elements is a special case that immediately returns always).


GCentral
0 Kudos
Message 3 of 4
(2,199 Views)
Solution
Accepted by topic author Sannar

Actually, it was not an issues at all, I didn't know that the Network stream was not installed when I installed all the other stuff. Now I installed it and it's working fine.

 

Thanks very much for your time and support

Sankar

Message 4 of 4
(2,146 Views)