PA-Paul Posted March 8, 2009 Report Share Posted March 8, 2009 Hi all, I'm writing an application with a GUI containing a tab control (amongst other things!) and one thing I want to do is initialise the "value" of the tab (and various other FP objetcs) when the app runs. As there are a number of things I want to initialise, I decided that I should create a cluster (strict.TypeDef) of references to each FP object I might want to control from within a Subvi somewhere within my app. This is the first time I've really used control references, so its taken me a bit of time to sort out. To start with, I created a custom control, placed a cluster and then filled it with "control refnum" controls, each appropriately named for my FP objects. This worked ok, but when using subvis linked to these references, I could only set "generic" properties within property nodes. I then discovered that I can assign "type" to the control refnums by dragging and dropping controls of the appropriate type into the refnum. Great, now I can set type specific properties within my subvis... The problem I encountered was that, the tab control on my FP was saved as a strict type def... I found that if I dragged and dropped my (strict typedef) tab control into a control refnum, and then placed that within my (strict typedef) cluster of refnums, if I subsequently modified the tab control, it broke the refnum cluster... Is this normal? As I say, I'm quite new to this whole "refnum" thing! I have ended up using a control refnum with a generic tab control "in" it, and with "include data type" disabled in the options. Which works, as I can still set "tab control specific" properties... Is that the best thing to do? I also disconnected my tab from the typedef, since actually, its only ever used once and on the FP, so it doesn't make much sense to me now to have it saved as a strict typedef! Anyway, any advice on using refnums and strict type defs would be gladly recieved! Thanks Paul Quote Link to comment
crelf Posted March 8, 2009 Report Share Posted March 8, 2009 I *think* I know what you're asking, but can you please upload a little example of what you're acheived? I'm not asking for you to upload you app - just an example of the things that are pertinent to the question. Quote Link to comment
PA-Paul Posted March 8, 2009 Author Report Share Posted March 8, 2009 QUOTE (crelf @ Mar 7 2009, 07:18 PM) I *think* I know what you're asking, but can you please upload a little example of what you're acheived? I'm not asking for you to upload you app - just an example of the things that are pertinent to the question. Ok, so attached is a simple example, I've thrown a couple of controls onto a front panel. The tab control is a strict typedef (file included in the zip). I've also placed a cluster of refernums (also a strict typedef) with a reference to each control, including the tab. The refnum for the tab control was created by placing a control refnum on the FP of the cluster control, and then dragging and dropping the typdef'd tab control into it. The problem I have is that now, if you make any change to the tab control typedef, the refnum cluster "breaks"... why?! As it happens, I now realise there's no need for me to make my tab control a strict typedef as its only used once anyway, so its not such an issue. But I'd still be interested to know why the above happens! Thanks for your help/advice! Paul Quote Link to comment
jgcode Posted March 9, 2009 Report Share Posted March 9, 2009 QUOTE (Ic3Knight @ Mar 8 2009, 05:44 AM) The problem I have is that now, if you make any change to the tab control typedef, the refnum cluster "breaks"... why?! Hi Paul The FP refnum control/indicator breaks because when you right click the control reference and select create indicator/control it is not linked to the typedef file. It only contains the a snapshot of the current datatype. This will be the case of other datatypes that can change also e.g. clusters, enums (tab)... Check the video below (no audio) to see one way on how to link the FP refnum control/indicator to the typedef file. Regards JG In the video I create a tab typedef control, Then I create a control reference and a FP refnum control/indicator, I then edit the FP refnum control/indicator so that it is associated with the typedef control, I use the run arrow because sometimes it seems the datatype checking is done at run time (so if it appears broken sometimes its not - and vice versa). Sometimes I also make the FP refnum control/indicator a typedef so when I use it in clusters I know it is correctly linked and not a snapshot of data. This can catch me out, no different to when you create a constant off of a Value attribute of a generic property node for an enum/cluster datatype! Quote Link to comment
PA-Paul Posted March 9, 2009 Author Report Share Posted March 9, 2009 Hi, I like Jing... not seen that before, my turn! So, I still have a problem! I've done much the same as you did in the video, only my refnum control resides within a strict typedef cluster... this cluster is what breaks if I change the tab control type def. as in the video below Download File:post-14639-1236510645.swf Any more thoughts as to why this breaks? (also, how did you embed the video into your post so its visible without having to click an icon like mine?) Thanks! Quote Link to comment
PA-Paul Posted March 13, 2009 Author Report Share Posted March 13, 2009 Hi all, Don't suppose anyone has any thoughts on this? I still can't see why the cluster breaks... Any help would be most gratefully received! Cheers Paul Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.