12-25-2015 06:35 AM
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.
12-25-2015 08:41 AM
12-25-2015 08:57 AM
Instead of citing "Ping examples" that have "no information about latency", do you own experiment:
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
12-25-2015 01:46 PM
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.
12-25-2015 02:44 PM
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):
Bob Schor
P.S. -- you shouldn't need to specify any additional parameters (line -n) to the Ping command.
12-28-2015 11:28 AM
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)
12-28-2015 07:45 PM
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 ...
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
01-03-2016 04:00 AM - edited 01-03-2016 04:14 AM
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?
01-03-2016 09:58 AM
@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
01-03-2016 11:19 AM
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.
Bob Schor