09-04-2011 06:59 PM
I have a subVI which has the front panel showed up in a main VI. When I use a function to enumerate the controls and indicators in this subVI, it shows that some controls having the same name. For example: 2 controls named "Input1", the first "Input1" and the second "Input1". I read somewhere in this forum that LabVIEW allow controls with the same name (even controls with no name/label).
The problem raised when I used Invoke Node function in LabVIEW 2010 in order to access to the first control "Input1" in subVI. One of the input of this function is a string which describe the name of control/indicator. Because I have 2 controls with the same name "Input1", LabVIEW only can handle one of 2 "Input1" (the first "Input1"). I cannot access to the second "Input 1".
How can I resolve this problem? Does LabVIEW has another function which handle the control/indicator not by its name?
09-04-2011 07:26 PM
09-04-2011 07:30 PM
09-04-2011 07:41 PM - edited 09-04-2011 07:44 PM
Sorry for my mistake. Let me give some more details. I only have an executable VI that has a subVI within it. It means I don't have the source code, so I cannot modify anything even just changing the name of a control.
I can open a reference to this executable VI (application), then I use Invoke Method (Properties.Set) to change a control's value (one of "Input1") in this VI. Hence the problem raises.
09-04-2011 11:10 PM
I don't know if this works in an executable, but does work on a standalone VI, so it may be worth a shot.
09-05-2011 10:29 AM
09-05-2011 10:29 AM
09-05-2011 05:59 PM - edited 09-05-2011 06:01 PM
I think I had the solution with Control[], but it's kind of another method. With Invoke Node, we still cannot resolve the problem. Here is the description of input of Set Method of Invoke Node:
Control Name | Name of the control or indicator whose value you want to change. LabVIEW searches the front panel tabbing order for the name of the object and changes the value of the first object whose name matches the name you wire to this input. |
So with Set method, we cannot access to the controls which have the same name.
In my particular case, I have a control named "Outputs In". I also have a indicator named "Outputs In". I think the tabbing order of the indicator is less than the control, so I can only access to the indicator.
I use LabVIEW 2010, I will try to downconvert the application to 2009 version and unzip the llb file. But I read somewhere in this forum, from LabVIEW 8.0 we cannot change the extension of LabVIEW application from .exe to .llb and unzip anymore. Anyway, I will try it.
Thank for all your supports.
09-05-2011 09:25 PM
Not llb but zip. If you change the exe extension to zip you can open it. But as I said this is only something I heard about. I looked into it and apparently you can not open and edit the VIs. You can only see their names. So this will totally not help you at all. As for upconverting or downconverting I don't know what I was thinking. It's an exe!.
09-05-2011 10:19 PM
The thing is that you can not use the set control value method. You have to set the control value property.
Use something like this to find the index of the control you are interested in.
After you find the index use the value property