LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Win32 COM method to set control's Value(Signaling) property?

Solved!
Go to solution

I can set the value of a LabVIEW VI's front panel control using the following Python code:

 

import win32com.client
labview = win32com.client.Dispatch("Labview.Application")
VI = labview.getvireference(r'C:\path\to\target.vi')
VI.setcontrolvalue('Numeric','5')

 

However this changes the control's value, but doesn't fire its Value Changed event. 

 

How do I change the control value and fire Value Changed via the COM interface, as setting the Value(Signaling) property would do from within LabVIEW? I couldn't find this documented anywhere nor figure out how to get a list of available methods for the VI object.

0 Kudos
Message 1 of 4
(3,883 Views)

I'm no expert in this, but what I can tell you is that Value (Signaling) is definitely a property, as you mention in your title. Set Control Value is a method and I don't think there is a Set Control Value Signalling method that goes along with it.

 

Do you know if there is a way to set properties of controls through win32com? If so, maybe that could lead you down a path to finding the Value (Signaling) property?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 4
(3,821 Views)
Solution
Accepted by topic author kittentronic

I'm afraid the LabVIEW ActiveX server interface was released before the whole VI server was enhanced to contain many more possibilities like control properties and such. And that LabVIEW ActiveX server interface has only been extended to add some support for Projects and project items that appeared with LabVIEW 8.0 but never to support the entire VI server object hierarchy including front panel and diagram items (which would be a herculian task since that object hierarchy is VERY immense).

And since ActiveX is according to Microsoft already a legacy technology since they introduced .Net some 10 years or so ago, the chance that NI will revisit the ActiveX server interface to add any new features is so close to 0% that you can't measure the diifference with 0%! 🙂

The recommended way to do something like this nowadays is to implement your own inter application communication scheme using a server VI in LabVIEW that waits for commands and a library in Python or whatever to send those requests to that server.

 

Rolf Kalbermatter
My Blog
Message 3 of 4
(3,799 Views)

Thanks James, and thanks Rolf - it's not what I wanted to hear, but I'm sure you will be correct 😞

0 Kudos
Message 4 of 4
(3,783 Views)