| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 ?????? |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| 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 |
|
#4
| |||
| |||
| 1st, how to simulate ctrl+C command? 2nd, how to send in this command to System exec.vi once it has been run? |
|
#5
| |||
| |||
| Dear mike, could you shed some light on simulating the Ctrl+c command Thanks, Mathan |
|
#6
| |||
| |||
| 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 |
|
#7
| |||
| |||
| 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&message.id=312631&que ry.id=142097#M312631" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&message.id=312631&que ry.id=142097#M312631</a> Hope it helps.Mike |
|
#8
| |||
| |||
| 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 |
|
#9
| |||
| |||
| 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 |
|
#10
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.