LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

during cmd prompt, need to send control c to break

Solved!
Go to solution

hi,

i am using labview and calling a cmd prompt window (syst exec) and executing a command.


upon completion of the command, i am able to read the contents of the cmd prompt window.

 

the problem is, i have to physically hit "control and c" on the keyboard to get the application to stop.

 

i seem unable to automatically send the "control c" (03) to the cmd prompt, in order to stop it, while it is executing.

 

anyone have any idea's?

 

thanking you in advance.

 

0 Kudos
Message 1 of 15
(8,439 Views)

I'm sure there's a better way to do this, but you could generate a user event.

You could programmatically have the computer press ctrl+c

Cory K
0 Kudos
Message 2 of 15
(8,435 Views)

i have tried to send control c programmatically, but the cmd prompt window seems to disregard the command.

 

 

0 Kudos
Message 3 of 15
(8,428 Views)

It sounds like you are loosing the focus of the window. I assume you are using the windows utils?. See picture. This works for me.

 

 

Richard






Message 4 of 15
(8,410 Views)

hi again,

 

i had some time to try out what you suggested.

 

the command i am running, does not seem to want the control c command in the dos prompt window.

 

i set the cmd window to top, and i send along the control c to break the loop, but it doesn't get accepted.

 

but, when i physically hit control and c on my keyborad it breaks the loop. (it does not register in the cmd window)

 

is there another way to do this?

 

thanking you in advance.

 

0 Kudos
Message 5 of 15
(8,385 Views)

Hi,

 

Can you please post a screenshot of your code? Thanks!

 

Ipshita C.

National Instruments
Applications Engineer
0 Kudos
Message 6 of 15
(8,353 Views)
Solution
Accepted by topic author demo

hi,

 

i actually found a vi on ni that did the trick.

it's great.

 

wanna thank everyone for thier input.

 

have a great day and until we meet again,

take care.

 

Message 7 of 15
(8,344 Views)
It would be nice to link to the VI so others who have your problem can benefit from this thread.
0 Kudos
Message 8 of 15
(8,338 Views)

here is the link...

 

hope it can help anyone who has the same problem.

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=401151&requireLogin=False

0 Kudos
Message 9 of 15
(8,334 Views)
I didn't know you could mark your own post as a Soloution.
Richard






0 Kudos
Message 10 of 15
(8,329 Views)