LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Invoke Node with controls which have the same name

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?

0 Kudos
Message 1 of 10
(1,202 Views)
You should just rename one of the controls.
0 Kudos
Message 2 of 10
(1,196 Views)
Although it is allowed it is not recommended. Lots of things are allowed but that does not mean they are correct. Just go to breakpoint and look for the Rube Goldberg thread. Why don't you just call one of them Input2?

Sorry but I don't know the answer to your question. I don't have any VIs that have controls with the same name. What you can do is name them Input1 and Input2 then give them both captions that say "Input1" I promise I won't laugh 🙂
=====================
LabVIEW 2012


0 Kudos
Message 3 of 10
(1,195 Views)

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.

 

 

0 Kudos
Message 4 of 10
(1,189 Views)

I don't know if this works in an executable, but does work on a standalone VI, so it may be worth a shot.

 

  1. Use the Front Panel Property, which will give you a reference.
  2. Using this reference, get the Controls[] Property, which gives you an array of ALL control references.
  3. Using these control references, you can set the value of each control.  You also can get the name of the control to find out which control the reference belongs to.
  4. Once you figure it out, the order will not change since it is a compiled EXE, so you can just index the array to get the proper elements.
  5. Make sure you close all the references you open.
Message 5 of 10
(1,178 Views)
Link, I knew it must have been something like that 🙂

What version of LabVIEW are you using? I think that in version 2009 you can rename the exe to .zip and unpack the zipfile. If you are lucky the VI is not password protected.Try to upconvert or downconvert if you are using a different version. I have never tried that but it is worth a shot. If not the controls [] suggestion is a good one.

Good luck!
=====================
LabVIEW 2012


0 Kudos
Message 6 of 10
(1,159 Views)
Link, I knew it must have been something like that 🙂

What version of LabVIEW are you using? I think that in version 2009 you can rename the exe to .zip and unpack the zipfile. If you are lucky the VI is not password protected.Try to upconvert or downconvert if you are using a different version. I have never tried that but it is worth a shot. If not the controls [] suggestion is a good one.

Good luck!
=====================
LabVIEW 2012


0 Kudos
Message 7 of 10
(1,158 Views)

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.

0 Kudos
Message 8 of 10
(1,139 Views)

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!. Smiley Surprised

=====================
LabVIEW 2012


0 Kudos
Message 9 of 10
(1,124 Views)

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.

 

Example_VI.png

 

After you find the index use the value property

 

Example_VI_BD.png

=====================
LabVIEW 2012


0 Kudos
Message 10 of 10
(1,111 Views)