LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loosing connection frequently with UDP

Hi,

 

I am transmitting data from the same PC that runs a VI for reading it. Initially I wrote a VI that read the data successfully but then I wanted to make the project modular and so I rewrote it. Now when I run the VI, it alternates between data read and timeout. I don't have a consistent data out of UDP read function. Now if were to run the old VI, it works fine. Could someone point out the error??

Download All
0 Kudos
Message 1 of 4
(2,592 Views)

It would help if you attached a VI rather than pictures.  You are only showing a couple of cases out of many.  And I can't see how this new modular subVI fits into the bigger scheme of things.

 

PS:  Losing <> "loosing"

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

I have attached the project. The version is 15.0

Look into Acquire Data.vi

0 Kudos
Message 3 of 4
(2,557 Views)

@GoKu25 wrote:

 

I am transmitting data from the same PC that runs a VI for reading it. Initially I wrote a VI that read the data successfully but then I wanted to make the project modular and so I rewrote it. Now when I run the VI, it alternates between data read and timeout. I don't have a consistent data out of UDP read function. Now if were to run the old VI, it works fine. Could someone point out the error??


Thank you for including the Project (though there were numerous "missing" VIs that made walking through things a little difficult).  There are a number of questions, not all of which pertain to the topic of UDP (I apologize in advance).

  • If you are "transmitting data from the same PC that runs a VI for reading it", why use a protocol at all?  Why not use a Queue, for example?
  • If you are interested in transmitting data and want reliable transmission, why use UDP (instead of TCP/IP, or Network Streams)?  The LabVIEW Help says "Use UDP in applications where reliability is not critical".
  • I notice that you use Clusters, and that many (but not all) have a TypeDef (good!).  I'm looking at UDPdata, which has three elements called devPositionX, devPositionY, and devPositionZ.  I recommend creating a Position cluster with X, Y, and Z elements, and having devPosition be one of these clusters.  Similarly, I see a 4-element orientationQ0 to Q3 (Quaternions?) that should also be a sub-cluster.
  • I happened upon a MathScript computation of the distance between 2 3D points (in Cluster to String).  If you have a Position Cluster (definition), it is really easy to compute, right in LabVIEW, the Distance Between these two Positions -- indeed, I'd probably make this a sub-VI, thinking I might need to use this elsewhere ... (sorry, this is a LabVIEW 2016 Snippet, but you can see how to do this).Distance Between.png

Bob Schor

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