n00bzor Posted March 5, 2009 Report Share Posted March 5, 2009 Hey, trying to ping a computer using this http://forums.ni.com/ni/board/message?boar...=235762#M235762 . Any ideas on how to make it ping continously? I tried "ping www.google.com -t" , problem is it gets stuck in sys exec, it won't pass the results further on (waiting for the final output). Any ideas? Thanks. Later Edit : I replaced -t with -n, now it's pinging the host for the number of times put in, but i really want to make it run continuously. Quote Link to comment
Antoine Chalons Posted March 5, 2009 Report Share Posted March 5, 2009 QUOTE (n00bzor @ Mar 4 2009, 12:44 PM) Hey, trying to ping a computer using this http://forums.ni.com/ni/board/message?boar...=235762#M235762 . Any ideas on how to make it ping continously? I tried "ping www.google.com -t" , problem is it gets stuck in sys exec, it won't pass the results further on (waiting for the final output). Any ideas? Thanks.Later Edit : I replaced -t with -n, now it's pinging the host for the number of times put in, but i really want to make it run continuously. Hi, What is this parameter : "-t" for the ping command ? Is it not a mistake ? As you can see here, there is no "-t" for ping command.. maybe you need -f, no ? Hope this helps Quote Link to comment
Phillip Brooks Posted March 5, 2009 Report Share Posted March 5, 2009 QUOTE (Antoine Châlons @ Mar 4 2009, 07:00 AM) What is this parameter : "-t" for the ping command ? I think -t is a windows specific parameter. C:\Documents and Settings\Phil>ping -?Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] target_nameOptions: -t Ping the specified host until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C. -a Resolve addresses to hostnames. -n count Number of echo requests to send. -l size Send buffer size. -f Set Don't Fragment flag in packet. -i TTL Time To Live. -v TOS Type Of Service. -r count Record route for count hops. -s count Timestamp for count hops. -j host-list Loose source route along host-list. -k host-list Strict source route along host-list. -w timeout Timeout in milliseconds to wait for each reply. The reason it doesn't work from LabVIEW is that it the system exec.vi will wait until ping completes; it doesn't complete until you press a key to end the ping. I think you will need to use the -n parameter in a loop or find a different implimentation of ping. Quote Link to comment
Antoine Chalons Posted March 5, 2009 Report Share Posted March 5, 2009 QUOTE (Phillip Brooks @ Mar 4 2009, 01:29 PM) I think -t is a windows specific parameter. C:\Documents and Settings\Phil>ping -?Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] target_nameOptions: -t Ping the specified host until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C. -a Resolve addresses to hostnames. -n count Number of echo requests to send. -l size Send buffer size. -f Set Don't Fragment flag in packet. -i TTL Time To Live. -v TOS Type Of Service. -r count Record route for count hops. -s count Timestamp for count hops. -j host-list Loose source route along host-list. -k host-list Strict source route along host-list. -w timeout Timeout in milliseconds to wait for each reply. Oh.. Indeed.. sorry I thought it was a typo, but no.QUOTE (Phillip Brooks @ Mar 4 2009, 01:29 PM) The reason it doesn't work from LabVIEW is that it the system exec.vi will wait until ping completes; it doesn't complete until you press a key to end the ping.I think you will need to use the -n parameter in a loop or find a different implimentation of ping. Well, the SystemExec.vi has a input parameter "wait until completion? (T)" just set it to False and that should be fine. Quote Link to comment
Phillip Brooks Posted March 5, 2009 Report Share Posted March 5, 2009 nOObzor; why do you want to continuously ping the remote device? Quote Link to comment
n00bzor Posted March 5, 2009 Author Report Share Posted March 5, 2009 QUOTE (Phillip Brooks @ Mar 4 2009, 04:10 PM) nOObzor; why do you want to continuously ping the remote device? It has to do with calculating the delay between two computers, i'm trying to do it using the delay from ping. -t is indeed a windows specific command, it pings the host until stopped.Thanx guys, i'll try it and get back to you. I'm not tring to flood anyone so relax. QUOTE (Antoine Châlons @ Mar 4 2009, 02:37 PM) Well, the SystemExec.vi has a input parameter "wait until completion? (T)" just set it to False and that should be fine. Tried that, didn't seem to work, i guess i'll have to stick to using -n and a loop, although i get a lot of overhead because of this(this is part of a much larger program) Quote Link to comment
Mark Yedinak Posted March 5, 2009 Report Share Posted March 5, 2009 You can use this method. This is a direct call method using the winsock library. It works well and you can put it into a loop. However, BE CAREFUL if you do use this in a loop. If you don't introduce any delay you can easily flood the receiving device with ping requests. I do wish that NI would add a native ping to LabVIEW. Quote Link to comment
n00bzor Posted March 6, 2009 Author Report Share Posted March 6, 2009 QUOTE (Mark Yedinak @ Mar 4 2009, 05:44 PM) You can use this http://forums.ni.com/ni/board/message?board.id=170&message.id=70801' target="_blank">method. This is a direct call method using the winsock library. It works well and you can put it into a loop. However, BE CAREFUL if you do use this in a loop. If you don't introduce any delay you can easily flood the receiving device with ping requests. I do wish that NI would add a native ping to LabVIEW. Ok, thanks a lot, i'll try that one too. Quote Link to comment
Neville D Posted March 6, 2009 Report Share Posted March 6, 2009 You might try this library modified by Rolf K over at the NI site: Raw Socket Ping Neville. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.