LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network latency measurement with GPS position log

The task is to measure wireless network latency (and also how much packets are lost). It can be easily done by the Windows PING command, BUT.. i need to combine latency results with current position (and velocity), also there is a lot of measurements (hundreds and more in one log).

 

The idea was introduced by my friend: take a labview!


For today I now that I need a GPS receiver with NMEA 0183 data output (is it correct?)

But a ping command examples has output only with "packet was delivered or not", but there are no information about latency.

https://decibel.ni.com/content/docs/DOC-16157

https://decibel.ni.com/content/docs/DOC-15341

 

Can you suggest some way to finish this task? I'm a newbee in labview.

0 Kudos
Message 1 of 11
(4,306 Views)
If you parse thel response from the ping command, one of the columns is "time". That may be what you are looking for.

There is also a way to do a ping using a .NET call which might be helpful.

Mike...

PS: you are correct about the GPS receiver.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 11
(4,282 Views)

Instead of citing "Ping examples" that have "no information about latency", do you own experiment:

Ping.png

returns the folowing:

 

Pinging a1927.q.akamai.net [23.74.8.139] with 32 bytes of data:
Reply from 23.74.8.139: bytes=32 time=47ms TTL=56
Reply from 23.74.8.139: bytes=32 time=44ms TTL=56
Reply from 23.74.8.139: bytes=32 time=43ms TTL=56
Reply from 23.74.8.139: bytes=32 time=62ms TTL=56

Ping statistics for 23.74.8.139:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 43ms, Maximum = 62ms, Average = 49ms

 

Now, you have to do a little bit of work to parse this multi-line string and retrieve the average round-trip time (and, possibly, handle cases where it times out, or otherwise goes astray), but it is certainly doable in LabVIEW.

 

Bob Schor

0 Kudos
Message 3 of 11
(4,270 Views)

Right, its work!

I was taken a lv example with ping and that what I get: now I have no idea how to take more than one answer: I can take only first measurement result.

0 Kudos
Message 4 of 11
(4,245 Views)

Sounds like you need to learn about the String functions and how to parse a string.  Here are some suggestions (which will also apply to learning LabVIEW):

 

  • Spend time and view the Tutorials, some of which are listed in the upper right corner of the Forum's first Window.
  • Make a simple VI, put a multi-line string (perhaps the one returned by Ping) into a Constant or Control, and just try out various functions to see how they work.
  • Think about what you want to do.  One way to get the Round Trip Time would be to first get the last line of the String (how would you do that?), then parse it to get the Average Time.
  • Think about what to do if the line you expect to find isn't present (perhaps the site you are pinging doesn't exist).

Bob Schor

 

P.S. -- you shouldn't need to specify any additional parameters (line -n) to the Ping command.

0 Kudos
Message 5 of 11
(4,221 Views)

I dont need an average time. All what I want now is to put all results into a table (which should be saved when finished).

Unfortunately, the table remains empty (intermediate3 window show delay number as requeired)

0 Kudos
Message 6 of 11
(4,139 Views)

Attach executable code (easiest to do if you attach a VI), not a static picture of code (which we cannot run and test unless we, ourselves, enter it by hand into our copies of LabVIEW).

 

I'm not sure what your code is supposed to do, but it clearly doesn't parse the multiple lines obtained from the Ping into an array of lines (which you could pass to a For loop, parse each line for whatever you want, and output the results).  Here is one way to get an Array of Lines ...

Ping Lines.png

Note that this "picture" is, in fact, a LabVIEW Snippet -- if you drag this Snippet to a blank LabVIEW Block Diagram (in LabVIEW 2014 or 2015), it will magically turn into LabVIEW Code.

 

The function inside the While Loop is called Scan String for Tokens.  Look at its Help file to see how it works.

 

Bob Schor

0 Kudos
Message 7 of 11
(4,105 Views)

I was really surprised about snippets from forum to LV2014/2014.

Now I'll add my snippet (which was re-created in LV2014). I dont know why it does not work (numbers in a table are wrong)

Untitled 03.01.2016.vi (44 KB)

And Yes - why my VI has no preview?

0 Kudos
Message 8 of 11
(4,032 Views)

@orion777 wrote:

I was really surprised about snippets from forum to LV2014/2014.

Now I'll add my snippet (which was re-created in LV2014). I dont know why it does not work (numbers in a table are wrong)

Untitled 03.01.2016.vi (44 KB)

And Yes - why my VI has no preview?


You attached a link (shown on the Forum Toolbar as a chain of three links).  The next Icon over is for images, including Snippets (which, by default, are saved as .png files).  If you make a Snippet and save it as a .PNG, you can insert it as an Image using this Toolbar command (which is what I think you mean by a "preview").  Note -- if your VI takes more than one screen to view (and we've seen some here that take 50 screens!), do not attach a Snippet here!!!

 

Bob Schor

0 Kudos
Message 9 of 11
(4,009 Views)

OK, this question is about your code.  I suspect that there is a fair amount of "elementary LabVIEW" that you don't know or understand.  Here are some questions for you think about.

  • Why do you have a loop?  Do you mean to do the same Ping over and over again?
  • Why is the default period for the loop 1000 seconds?
  • If you understand Data Flow, you will realize that, by default, you cannot stop the loop until 16 minutes and 40 seconds have elapsed, no matter when you push the Stop button.  Is this (strange behavior) what you intend?
  • Why are you building a Table?  Why are you using the Dynamic Data Type here?  What do you think the values in the Table represent, and how could that be useful to you?

Bob Schor

0 Kudos
Message 10 of 11
(3,997 Views)