From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do keyboard shortcuts to an external program?

Hi everyone,
i'm developing a program in labview that reads files created from an external program (an usb oscilloscope interface) and analyzes them.
That problems is that I need to start manually, before, the acquisition of data on the oscilloscope interface and than I have to start the labview program; that's not really elegant and efficient, so I whish to know if it's possibile to let my labview program open the oscilloscope interface and tell to it to start the acquisition.

Now, the exec subvi let me start the program, but I dont know how to start the acquisition.
With the oscilloscope interface as active window I can start the acquisition with the keyboard shortcuts ctrl-t ctr-g. Is it possible to let the program send to windows the request of execute those keyboard shortcuts on the active window?
The oscilloscope doesnt have any ActiveX interface.

Sorry for my bad english,
and thank you for the help,
filippo
0 Kudos
Message 1 of 6
(2,475 Views)
Hi filippo,
you can use the Windows API to send key events to other programs.
Mike
0 Kudos
Message 2 of 6
(2,455 Views)
Thank you for your answer,
I'm still new on labview, can you gently tell me more on how to use the windows api to send key events?

Really thank you,
filippo
0 Kudos
Message 3 of 6
(2,453 Views)
You can use the VI posted in this reply to send keys. Note that this sends the keystrokes to the window that is active. This means you have to first activate the window. To do this you can use the Windows API utilities found here. Specifically, use "ShowWindow".
0 Kudos
Message 4 of 6
(2,443 Views)
I'm curious why you aren't controlling the scope directly from LabVIEW. What is the make and model?
0 Kudos
Message 5 of 6
(2,440 Views)
The model is a Link Instruments DSO-8502. Is there a VI that acquire the signal directly from LabView?
Anyway tomorrow I'll try to use the VI for keys.

Really thanks for your answers and help,
filippo
0 Kudos
Message 6 of 6
(2,427 Views)