Ping with '-t'

This is a discussion on Ping with '-t' within the labview forums in Programming Languages category; I am a new user to LabView!  I was playing with System exec.vi for the command 'ping'.  It worked out find as it is.  But, now, the problem comes when I use 'ping xxx.xxx.xxx.xxx -t'.  In Windows, the only way to stop this execution is by pressing ctrl+C.  How to do it with System exec.vi though!  Anyone can help me with it?   Thank you!? BooJay ? 07-29-2008 03:53 AM ??????...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-29-2008, 05:10 AM
BooJay
Guest
 
Default Ping with '-t'

I am a new user to LabView!  I was playing with System exec.vi for the command 'ping'.  It worked out find as it is.  But, now, the problem comes when I use 'ping xxx.xxx.xxx.xxx -t'.  In Windows, the only way to stop this execution is by pressing ctrl+C.  How to do it with System exec.vi though!  Anyone can help me with it?
 
Thank you!? BooJay ? 07-29-2008 03:53 AM ??????
Reply With Quote
  #2  
Old 07-29-2008, 05:10 AM
MikeS81
Guest
 
Default Re: Ping with '-t'

Hi BooJasy,
afaik, there is no command to stop it. You can only send what the ping.exe supports. But you can simulate the "Ctrl+C" command with LabVIEW.
Mike
Reply With Quote
  #3  
Old 07-29-2008, 05:10 AM
Graziano
Guest
 
Default Re: Ping with '-t'

Hi!    I don't know if there's a way to kill a process launched with System exec, but you can work araund the problem this way: crfeate a loop, inside this loop you launch ping (not -t option) and wait for completion.  If no one stopped application, at the next loop iteration you redo a system exec ping.   You can set a fixed number of pings to send with "ping -n <number of pings> <IP.address>", just like ping -n 10 www.google.com   This is not optimized but it can be an "agile" way for making it work!graziano
Reply With Quote
  #4  
Old 07-29-2008, 05:40 AM
BooJay
Guest
 
Default ??? Re: Ping with '-t'

1st, how to simulate ctrl+C command?
2nd, how to send in this command to System exec.vi once it has been run?
Reply With Quote
  #5  
Old 07-29-2008, 05:40 AM
mathan
Guest
 
Default Re: Ping with '-t'

Dear mike,
could you shed some light on simulating the Ctrl+c command
Thanks,
Mathan
Reply With Quote
  #6  
Old 07-29-2008, 05:40 AM
BooJay
Guest
 
Default ??? Re: Ping with '-t'

running with loop properly won't be an option, either
because what I trying to do is I would let ping.exe for certain amount of time.  then stop it.
so, what I really need it here is to kill System Exec.vi
Reply With Quote
  #7  
Old 07-29-2008, 05:40 AM
MikeS81
Guest
 
Default Re: ??? Re: Ping with '-t'

Hi BooJay,
you can use the functions from the user32.dll to simulate the key down event. The viīs and the way how to do it, are in this thread. :smileyhappy:<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=312631&amp;que ry.id=142097#M312631" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=312631&amp;que ry.id=142097#M312631</a>
Hope it helps.Mike
Reply With Quote
  #8  
Old 07-29-2008, 06:10 AM
BooJay
Guest
 
Default ??? Re: ??? Re: Ping with '-t'

Hi Mike,
Thanks for the help!&nbsp; By the way, what version of LV you used for that user32.dll?&nbsp; I can't use it since there are so broken wires!&nbsp; And, Do you think I can still send in command to the same System exec.vi after I executed the ping -t?
because I triend to send in multiple commands through the same System exec.vi?&nbsp; it won't work
Reply With Quote
  #9  
Old 07-29-2008, 06:10 AM
MikeS81
Guest
 
Default Re: ??? Re: ??? Re: Ping with '-t'

Hi BooJay,
there are broken wires, because i wrote it in LabView 8.5 and saved it for 8.0. In 8.0 are no error in and out terminals for the "call library node". Do you wait until the system exec is ready? You can connect a false constant to it. You can send as many commands as you need if you donīt wait for the execution.
&nbsp;
Mike
Reply With Quote
  #10  
Old 07-29-2008, 06:40 AM
BooJay
Guest
 
Default ??? Re: ??? Re: ??? Re: Ping with '-t'

Hi Mike,
&nbsp;
I will give it a try again, I am currently using 8.2!&nbsp; And, here is what I really want to do.
&nbsp;
I want to write a program, which will ping an indicated IP for a certain time.&nbsp; when the time is up, program will send in Ctrl+C to stop it.&nbsp; Then, I will get the statistic out of program.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 11:08 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.