LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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 上編輯的訊息
0 Kudos
Message 1 of 15
(4,700 Views)
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
Message 2 of 15
(4,691 Views)
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
Message 3 of 15
(4,690 Views)
1st, how to simulate ctrl+C command?
2nd, how to send in this command to System exec.vi once it has been run?
0 Kudos
Message 4 of 15
(4,680 Views)

Dear mike,

could you shed some light on simulating the Ctrl+c command

Thanks,

Mathan

0 Kudos
Message 5 of 15
(4,677 Views)
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
0 Kudos
Message 6 of 15
(4,676 Views)

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. Smiley Happy
http://forums.ni.com/ni/board/message?board.id=170&message.id=312631&query.id=142097#M312631

Hope it helps.
Mike

Message 7 of 15
(4,669 Views)

Hi Mike,

Thanks for the help!  By the way, what version of LV you used for that user32.dll?  I can't use it since there are so broken wires!  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?  it won't work

0 Kudos
Message 8 of 15
(4,659 Views)
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.
 
Mike
0 Kudos
Message 9 of 15
(4,654 Views)
Hi Mike,
 
I will give it a try again, I am currently using 8.2!  And, here is what I really want to do.
 
I want to write a program, which will ping an indicated IP for a certain time.  when the time is up, program will send in Ctrl+C to stop it.  Then, I will get the statistic out of program.
0 Kudos
Message 10 of 15
(4,649 Views)