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: 

Windows System Commands over TCP/IP using Labview

I have several computers that are connected to multiple cameras. Each camera comes with its own separate software. I record each camera based on random events (not timed or sync'd in any way). I have been toggling through each computer via KVM switch to start/stop recording for each camera manually within each software. But I noticed that each software has a hotkey start and stop button. What I am hoping to do with Labview was to put all the computers on a network switch with unique IP address. Then from one of the networked computers I would like to have a small Labview program connected to a start/stop button front panel to initiate recording via Windows system commands to each unique IP address. Basically I would look at an individual Windows task or window name, make that window active, simulate a hotkey button press, and then move on to the next software window. My question is if somebody knows of a way to send such commands to a computer using Labview? I had to do something similar years ago with Advanced Task Scheduler for timed events so it would seem possible with Labview.

 

Thanks in advance.

 

Nick

0 Kudos
Message 1 of 3
(2,250 Views)

I would attempt to do this with AutoIT instead of LabVIEW. It's designed for scripting Windows tasks like sending key commands or button presses to a specific window. It's probably possible to call it from within LabVIEW, if you want a LabVIEW user interface.

Message 2 of 3
(2,220 Views)

>My question is if somebody knows of a way to send such commands to a computer using Labview?

 

If you mean sending commands to another program, it depends on the program. For normal c++ programs it's usually not that hard. It's completely different then for instance a Java program, which is nearly impossible (since Java has OpenGL based UI's).

 

There are several techniques to do this from LabVIEW. Using .NET UI Automation" APIs might work (but for instance not for LabVIEW, since LV uses it's own controls\indicators that are no MS windows). This works great in combination with Inspect.exe. If you can "see" the elements in Inspect, you can use UI Automation API's to do it from LabVIEW (or c#, or whatever).

 

Sending Windows messages with SendMessage and PostMessage occasionally works as well. It's tricky though.

 

If you can get away with AutoIt, I'd stick to it. The other ways require "hacking" skills. Working knowledge of debuggers, MSDN, CallLibraryNode, etc. is required.

0 Kudos
Message 3 of 3
(2,201 Views)