09-05-2024 11:41 PM
Hello LabVIEW Community,
I am currently working on automating interactions with a LabVIEW VI using the COM API (ActiveX) and facing a couple of challenges that I hope to get some insights on:
Interfacing with Nested Controls:
I’m trying to manipulate controls within a VI, specifically buttons that are nested inside other controls or clusters. I can easily interact with simple controls, but I'm having trouble accessing controls that are part of a cluster or array and also say the browse button as part of the file path control. How can I programmatically access and manipulate these nested controls using the COM API? Is there a particular method or property I should be using?
Changes via COM API Displayed but Not recorded on the Front Panel even when the VI is running:
I’ve noticed that when I make changes to control values via the COM API, the modifications are immediately visible on the VI’s front panel but are not recorded as having been performed. This behavior is particularly confusing because I would expect the VI to update automatically. Do I need to implement additional functionality to continuously update the front panel, or is there a specific trigger or method to ensure the front panel reflects the changes made by the API in real-time?
Any suggestions, documentation references, or examples would be greatly appreciated!
Looking forward to your insights!
Thanks in advance!
FYI: I am using python and below is the VI and how I interact with it in Python. if you need the VI or it's string, please let me know.
09-06-2024 03:28 AM
Change your user name so it isn't your email adress!
You'll get a lot of spam!
09-06-2024 03:37 AM
As for the question, I'd suggest to first get this working from LabVIEW using VI Server.
Then I would take another step, using the COM interface from LabVIEW. But that might not help you.
In VI Server, you'd get references to nested controls of a cluster with the "All Controls" property.
An array is much trickier. You can use the "Element" to get a reference to the element. Not a element. You cannot change properties of individual array elements. Not manually, not with VI Server, not though the COM interface. You can modify individual array element values, by reading the array value, changing an individual value in the array, and writing the array as a value to the referenced control.
I don't know why controls aren't updating. Defer Panel updates turns this off and on, but if you don't turn it on, it should update.
09-06-2024 04:17 AM
Unfortunately, I tried changing My Alias in my NI Account and the change never reflected here. Thank you so much for the heads up
09-06-2024 04:38 AM
@RMutegeki wrote:
Unfortunately, I tried changing My Alias in my NI Account and the change never reflected here. Thank you so much for the heads up
It worked: