get or set control value on clone

This is a discussion on get or set control value on clone within the labview forums in Programming Languages category; I cannot get or set a control value on a clone VI (created by opening a ref to a re-entrant VI with the x08 flag and invoking the the Run method and opening the front panel).  I can open a ref to the clone vi by using it's clone name (parent.vi:1, for example) and get some properties back (like whether or not it's a clone VI with the "Is Clone VI" property) but the Control Value:Get methods (both variant and flattened string) return nothing - no error, just no data.  Is this expected behavior?  The LV Help for the Control ...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-13-2008, 11:10 AM
mesmith-nm
Guest
 
Default get or set control value on clone

I cannot get or set a control value on a clone VI (created by opening a ref to a re-entrant VI with the x08 flag and invoking the the Run method and opening the front panel).  I can open a ref to the clone vi by using it's clone name (parent.vi:1, for example) and get some properties back (like whether or not it's a clone VI with the "Is Clone VI" property) but the Control Value:Get methods (both variant and flattened string) return nothing - no error, just no data.  Is this expected behavior?  The LV Help for the Control Value:Get doesn't say anything about it not working on clones. I can start my reentrant VI with the run button (not as a clone) and I can read and write to the controls just fine.  Thanks, Mark  BTW - this is LV 8.5.1Message Edited by mesmith-nm on 08-13-2008 09:42 AM
Reply With Quote
  #2  
Old 08-13-2008, 03:10 PM
MikeS81
Guest
 
Default Re: get or set control value on clone

Hi Mark,i think it is because of the selected option. The helps says you can´t edit this instance. Why do you need it? Could using vi template a solution for you? Hope it helps.Mike 
Reply With Quote
  #3  
Old 08-13-2008, 03:40 PM
mesmith-nm
Guest
 
Default Re: get or set control value on clone

Mike, Thanks for the response, but I don't think this is the issue - I'm not trying to edit the VI (you are correct - a clone cannot be edited), I'm just trying to get the data displayed in a front panel control by opening a VI reference and using the Control Value:Get method thru an Invoke node.  I don't know if using a VI template would work here or not - my situation is one where the reentrant VI should work great.  I launch as many copies of a monitor display as the user desires to monitor different data streams.  Also, I have a work-around using the reentrant model that's meeting my needs.  What I really hope is that someone in the know (hint-hint - LabVIEW R&D?) will chime in and tell us whether or not I'm doing something illegal or whether the Control Value:Get method just isn't working as intended.  That would be great to know for future application development. Also, it doesn't matter whether I try to get the value using the VI Reference generated when I spawn the clone or whether I open a VI reference with the clone's name and the Open VI Reference function - I get the same behavior either way.  One thing that is kind of weird is that I for a while I still can use the clone's name and still open a reference when the clone VI is stopped and the front panel is closed - does it take LabVIEW a while to get the clone's name out of memory - does it wait to be garbage collected?  If I use the VI ref captured when the clone is spawned it behaves as expected and as soon as I close the clone the ref goes invalid.  BTW, the Run method used to spawn the clone has Auto Dispose Ref set to TRUE. Mark  Mark 
Reply With Quote
  #4  
Old 08-14-2008, 03:10 AM
MikeS81
Guest
 
Default Re: get or set control value on clone

Hi Mark,can you show us your vi. Your are right, it´s not the option. I made an example in 8.5 like i understand what you want and it works for me. Hope it helps.Mike


main.vi:
http://forums.ni.com/ni/attachments/...9208/1/main.vi


sub.vi:
http://forums.ni.com/ni/attachments/...49208/2/sub.vi
Reply With Quote
  #5  
Old 08-14-2008, 09:40 AM
mesmith-nm
Guest
 
Default Re: get or set control value on clone

Mike, You have interpreted my question correctly and you are correct - your example works exactly as I would have expected.  And this morning, when I re-booted my computer and checked my VI with the issue, it worked as expected.  So I have no idea what was going on.  All I know is yesterday, I got nothing - no error but no data and now after nothing more than a shutdown and reboot, it works.  Go figure. Thanks for your effort to create the example and confirm that this approach should work - it's useful information. Mark 
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 10:44 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.