Jump to content

Two questions about Xcontrols


Recommended Posts

Better late than sorry, I have started using Xcontrols a few weeks ago, and there are two thing that keep annoying me about these, I'm wondering if I could do anything about it (and a third bonus question whose answer I'm affraid I already know) :

1. Can I make template XControl to add the utility methods I keep implementing ?

2. When I open my project, everything is locked (classes and Xcontrol) and I have to manually unlock every single XControl before I can edit any class. Is there a way to achieve this faster, or to avoid it altogether ?

3, bonus question. Since I have some methods that I implement in every XControl I make, I would like to be able to call them without specifically knowing what class my XControl belongs to. Ideally, I would make a parent XControl class that my XControl would inherit from, but I dont think I can do that. Is there some way (tricky or not) I could achieve my goal ?

Edited by Ernest Galbrun
Link to comment

Better late than sorry, I have started using Xcontrols a few weeks ago, and there are two thing that keep annoying me about these, I'm wondering if I could do anything about it (and a third bonus question whose answer I'm affraid I already know) :

1. Can I make template XControl to add the utility methods I keep implementing ?

I have never tried to put an XControl in the templates folder, just go ahead and try, however the default XControl is located under \resource\Framework\Providers\xi\xctl.llb

2. When I open my project, everything is locked (classes and Xcontrol) and I have to manually unlock every single XControl before I can edit any class. Is there a way to achieve this faster, or to avoid it altogether ?

That is only so if a VI is in memory that has a reference to that XControl, I think you have some deadlock between a class and an XControl. Classes are always loaded into memory, if this has a reference to the xcontrol somehow (in the probe for instance), the XControl is locked. If the XControl has a reference to the class the class is locked.

3, bonus question. Since I have some methods that I implement in every XControl I make, I would like to be able to call them without specifically knowing what class my XControl belongs to. Ideally, I would make a parent XControl class that my XControl would inherit from, but I dont think I can do that. Is there some way (tricky or not) I could achieve my goal ?

Unfortunatly we cannot place an XControl inside the control class of LabVIEW to achieve such behaviour.

Ton

Link to comment

I have never tried to put an XControl in the templates folder, just go ahead and try, however the default XControl is located under \resource\Framework\Providers\xi\xctl.llb

Putting it in the template folder doesn't work. Changig the default xctl would suit me well, although I can't manage to change the control data types in the vis, do you know why/how to override this lock ?

That is only so if a VI is in memory that has a reference to that XControl, I think you have some deadlock between a class and an XControl. Classes are always loaded into memory, if this has a reference to the xcontrol somehow (in the probe for instance), the XControl is locked. If the XControl has a reference to the class the class is locked.

Every XControl has an object as its data type, I guess that is why the class is locked when the Xcontrol is locked. What I do not understand is why eveerything is locked by default when I open a project, and I am wondering if there is any way (key shortcut, anything) to unlock everything at once ?

Edited by Ernest Galbrun
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.