Discussions au sujet des autres produits NI

annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

Integrate an executable on labview

Hi
I'm using Labview 8.2.1 with Windows XP and I have an executable that command a shutter.
The exe opens a little window where I can click on a button OPEN or a button CLOSE.

Does it exist a means to execute the program from Labview and to open or close the shutter without having to click on any button?
0 Compliments
Message 1 sur 14
4 874 Visites
Hi! Smiley clignant de l'œil
You can modify the property concerning the execution behaviour like this:
 


Message Edité par ManuelR le 02-13-2008 02:20 AM
Manuel R
AE dans une autre vie
0 Compliments
Message 2 sur 14
4 854 Visites
Hi,
 
Manuel, I don't think that's what he meant. I guess that you want to open an executable from LabView ? You can do this with the system command VI as shown in the picture below.
And a way to use open or close your shutter without having to click on the button would be to use the Window API functions, first you should retrieve the Window handle of your application by using FindWindow and then you could use the function SendMessage to simulate a click on the button with the message WM_CLICK.
 
Hope this helps !
 
Best regards,


Message Edité par Maxime MULLER le 02-13-2008 02:40 AM
Tout télécharger
0 Compliments
Message 3 sur 14
4 848 Visites

Hi,

I developped for you an example, just download the zip file attached and open the VI named Main Executable.vi (others are some sub VIs I developped for this example).

So, this example shows you how to open an executable, in this case this is the Windows' Calculator. After that, it just sends some Windows Messages thanks to the Windows API  to the buttons 9, +, 5 and = to perform the operation 9 + 5. And of course, the calculator performs this operation.

Best regards,



Message Edité par Maxime MULLER le 02-13-2008 04:44 AM
Tout télécharger
Message 4 sur 14
4 837 Visites
Hi,

Thank you very much, this is exactly what I want to do.
With these VIs it's sure that I will manage to open/close the shutter from LabView.
Now I'm going to try to understand the commands and then I could make what I want.

Thank you very much for your clarity of answer and for your very clear and well explained example.

Best regards

Morgan

0 Compliments
Message 5 sur 14
4 828 Visites
Hi Maxime,

I try to use your VI with my problem and it almost succeed.
Actually I have to click on a button the name of which I don't know.
Maybe it's not the argument "BUTTON" that I have to transmit.

On the other hand, with the final stage I manage to close the exe.

Have you any idea?

Thanks

Morgan
Tout télécharger
0 Compliments
Message 6 sur 14
4 812 Visites

Hi,

I advise you to download  this software : Windows Spy it is a usefull freeware software which allows you to watch at programs and get the handles, the type of controls, etc... You'll be able to see wether the commands Open and Close are "BUTTON" types or note.

Moreover, if you can send your application I'll be able to have a look by myself.

Finally, to close your application, you should send some Windows' Messages to the application using the VI Send Message I built for you. The message might be WM_QUIT, or WM_CLOSE. I'll keep you informed.

Best regards,

0 Compliments
Message 7 sur 14
4 808 Visites
Hi,
 
Here is an updated version of the VIs which allows you to close your application at the end of the sequence.
 
Best regards,


Message Edité par Maxime MULLER le 02-13-2008 08:44 AM
Tout télécharger
Message 8 sur 14
4 800 Visites
Hi,

Thanks for the update.

Concerning the button I understood that it is not the problem.
Indeed when I put a stop point just before the VI "SEND CLICK" the shutter open/close.
Honestly I don't understand why, maybe it concerns transfert time.

Have you an idea?

Best regards

Morgan
0 Compliments
Message 9 sur 14
4 787 Visites

Hi,

Maybe you should put a "Wait" function just before the Send Click Vi.

Regards,

0 Compliments
Message 10 sur 14
4 773 Visites