Jump to content

Control Refnums question...


Recommended Posts

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

Link to comment

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

Link to comment

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!

Link to comment

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!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.