PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Value:Get Method doesn't work

I am using labview 8.2, and I am trying to access controls and indicators from a sub-vi that I ran.  I created a reference to a sub vi and then used "call by reference node" to run the vi.  Then I am taking that reference to the sub vi and using the invoke node to invoke  "Ctrl Val.Get" and I never have any data there, it is the default values.  The actual data doesn't appear.   If I take that same vi reference and also put it into a sub-panel the sub-vi looks perfectly fine and all the data is there.  What am I doing wrong that wont allow me to access the controls or indicators?
 
Thanks.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 1 of 8
(3,958 Views)
Hi remenakb,
 
An easier way to accomplish you goal may be placing the subVI on your block diagram and using the SubVI node Setup option.  You can make your code suspend on call, and Show Front Panel When Called.  Hope that helps.
Brian K.
0 Kudos
Message 2 of 8
(3,948 Views)

In the application I am trying to write I can not put the sub-vi on the block diagram because I am dynamically calling a different sub-vi with this code multiple times.

 

Is it possible to use the Get control values function in this method that I am trying?

Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 3 of 8
(3,933 Views)
Hi remenakb,
 
I was able to get the property to work with this example I attached.  If you look in the context help for the method "Get Ctl.Get" it states "The first time you call this method on a VI whose front panel is not open, this method returns the default values of the control or indicator rather than the actual values. Thereafter, it returns the actual value."
 
Is the front panel of your VI reference open or not?
Brian K.
0 Kudos
Message 4 of 8
(3,929 Views)
My front panel is not open, but I am displaying the front panel in a subpanel though.  I did not see that in the context help before.  It also says the values wont be kept track of unless you open the front panel or call that function.  I tried calling the function right after I open the vi reference and then I ran the sub vi and then I tried calling that function 2 more times and I am still getting the default values everytime I call that function.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 5 of 8
(3,927 Views)

Hi remenakb,

First of all were you able to get my small example to work.  I improved upon the examples and I think now I can see what your trying to do and what troubles you are having.  I have attached two programs.  One calls the second via VI server, but the Get Ctl property only works when you have stopped and restarted the second (called VI). The Get Ctl property seems to be working as intended, but if you think differently please tell me why.

Brian K.
Download All
0 Kudos
Message 6 of 8
(3,908 Views)
Thanks for the example code.  I am able to get that to work.  But it isnt exactly what I am trying to do.  I need to be able to pass variables into the sub vi that I am calling, and the only way I know to do that is to use the call by reference node, not the Run VI invoke node.  But I see now that I can't have a strict type vi that gets run.  Is there any other way to do this using strict type vi references?
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 7 of 8
(3,906 Views)

Hi remenakb,

I am not sure how that can be done. 

Also I am not really sure what the application would be.  Normally if you want to choose between subVIs you would just use a simple case structure.  Could you build a small concept design of what oyu want to be able to do?

Brian K.
0 Kudos
Message 8 of 8
(3,886 Views)