Jump to content

How to access the controls on the GUI from other programming languages?


Recommended Posts

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

Link to comment

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

Link to comment

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

Link to comment

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 :P ), 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).

Link to comment

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

Link to comment

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.

Link to comment
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.