Thang Nguyen Posted June 3, 2009 Report Share Posted June 3, 2009 Hi, I would like to know if there is any way to access the controls on the GUI of application made by LabVIEW from other programming languages? I am working on building the applications for my company. Now other engineers from testing department asked me if there is anyway they can do some scripting which can access to the control on my applications. They use Quick Test Pro or some test tool like that. Usually this will be done with applications written by other programming languages or using TestStand. But our company doesn't have TestStand. So if you have any experience about this case, please give me some recommendation. I appreciate your time for reading and answering my question. Best regards, Thang Nguyen Quote Link to comment
John Lokanis Posted June 4, 2009 Report Share Posted June 4, 2009 One option is to write a web service interface for your application. This can allow any language that can make http requests to script the functionality of your program. It is not quite like the traditional GUI test harnesses used by commercial software test systems but it might solve your need to allow other tools to control your LabVIEW app. If you just want to control the VI through the standard windows hooks into GUI elements, I am not sure if that will work with LabVEW EXEs. But, I have used a tool to do the opposite (control the GUI of a standard windows app from LabVIEW) that might offer some insight. The tool is called AutoIt. http://www.autoitscript.com/autoit3/index.shtml hope that helps. -John Quote Link to comment
Dan DeFriese Posted June 4, 2009 Report Share Posted June 4, 2009 Unfortunately, I haven't had the the need or time to use LabVIEW ActiveX Server since the Intermediate course. But you might look into this http://zone.ni.com/reference/en-XX/help/37...lv_activex_srv/. There's a some VBA example for calling LabVIEW from Excel in the examples folder: labview\examples\com\freqresp.xls. From Excel you can edit the LoadData macro to view the source. Hope this helps. Dan Quote Link to comment
Jeff Plotzke Posted June 4, 2009 Report Share Posted June 4, 2009 QUOTE (Thang Nguyen @ Jun 2 2009, 05:23 PM) I would like to know if there is any way to access the controls on the GUI of application made by LabVIEW from other programming languages? If you're trying to do automated testing or control of your application, I've used AutoIt3 before (jlokanis also brought this software up in his post). AutoIt is a sort of scripting language where you can define mouse/keyboard events, looping, file manipulation, display interaction -- you name it. This software can do a lot. In my application, I needed to test running my application with about 50 different configuration files. I pre-made the configuration files and then had AutoIt automatically copy a new configuration into the application directory, run my application, wait for it to start, click the Run Test button, wait for a pass/fail indicator to turn red or green, then click the exit button, and then start again with a new configuration file. After about 10 hours (and several beers since I didn't have to sit next to the tester ), I came back and only had to look at log files generated from my application. That said, the button clicks were done solely based on a command in the script that said "do a single-click at coordinates 123, 345 on the display") -- I couldn't actually pass in the button name or the like. I had to do several test runs to smooth everything out. Perhaps this is up your alley. Best of all, AutoIt is open-source (read: free). Quote Link to comment
Thang Nguyen Posted June 4, 2009 Author Report Share Posted June 4, 2009 Hi, The our test engineers can also interact with control based on the coordinator of the controls as Jeff say. But if we move the GUI, everything will be chance, so if I run the test on different day, this will be inconvinient. I finally find this topic at ni after reading about the link given by Dan: Calling LabVIEW VIs from Other Programming Languages http://zone.ni.com/devzone/cda/tut/p/id/5719 Thank you for all your information Best regards, Thang Nguyen Quote Link to comment
ShaunR Posted June 4, 2009 Report Share Posted June 4, 2009 This what your after? http://msdn.microsoft.com/en-us/library/ms646310.aspx Quote Link to comment
jdunham Posted June 4, 2009 Report Share Posted June 4, 2009 You can also enable VI Server in your built application, just by adding the same lines to built app's INI file as the lines in your LabVIEW.INI file (they can be removed later for security). With VI Server enabled, you can use methods like GetControlValue and SetControlValue or hit the Value(signalling) property of the booleans. You can do it from a remote machine with LabVIEW installed, since you probably don't want to put LV on the target machine. The main problem with this is that you probably have to spend time assisting your test engineers writing these little control programs, but it's certainly a reasonable alternative. Quote Link to comment
ShaunR Posted June 4, 2009 Report Share Posted June 4, 2009 QUOTE (ShaunR @ Jun 3 2009, 03:36 PM) This what your after?http://msdn.microsoft.com/en-us/library/ms646310.aspx Hwew's some examples in Delphi, C++, Java and VB (they all have wrappers around sendinput). some examples are for notepad, but the method works on any windows program. Delphi VB C++ Java Quote Link to comment
Thang Nguyen Posted September 21, 2009 Author Report Share Posted September 21, 2009 Hi Jdunham, Do you have a link to a NI article how to do this? Best regards, Thang Nguyen Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.