LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a list of known issues with XControls?

XControls have always been a bit of a mystery to me... sitting just outside my toolbox, mocking me, just begging me to try them once again. But each time I do, something tends to bite me 😞

 

I can usually get them to behave the way I want, but something always comes up. My latest attempt was to make a "tab control" that could be expanded programmatically at edit time. It was quite simple, with just a tab control with a bunch of pages pre-added, most of which were hidden. Some simple methods would show and hide the tabs, and clicking different tabs would alert the containing program via a user event. (They weren't populated tabs- it would just change which VI was shown in a subpanel, simulating arbitrary tabs).

 

This worked mostly fine but failed somewhere along the way to making an executable. I can't recall the specific issue, but it was some bug that made them basically just not render correctly. So, I remade it as a QControl, and have had no problems since.

 

In my case, the XControl was in an Actor, so it was reentrant and (IIRC) had a reference within the object's private data. LabVIEW apparently didn't like that and I'd have intermittent issues.

 

People generally talk about XControls as something to be avoided unless you REALLY know what you're doing, which has been my general experience. It's such a useful concept though and I'd like to add them here and there when they're the right tool for the job.

 

So, is there a list of things to avoid with XControls? Should I avoid them in reentrant VI's? Do they not play nicely with OOP? Does the facade not handle resizing properly?

 

Or did I just happen to make a buggy one and I should simply learn to write better code? 🙂

0 Kudos
Message 1 of 7
(274 Views)

Darren has some video presentation (i think it's the Silly ways to fix LV code) about XControls and he no longer recommends them due to unforseen issues. Take a look at the QControls in VIPM instead.

Though to show and hide tabs you don't need XControl. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 7
(227 Views)

I thought I remembered a video of his but couldn't find it. I read through the "silly ways" when I was looking for it and he definitely recommended against XNodes, but it didn't mention XControls. Maybe it was another one.

 

QControls are great, and it's what I used when I couldn't get my XControl to work right, but sometimes an XControl would be nice since it works at edit time.

 

This exercise was mostly just to wrap up some functionality that I found myself reusing. I could handle it all in my main code, but it was nice to have it packaged up. It didn't take long to write at all.

0 Kudos
Message 3 of 7
(201 Views)

I don't know about a video where Darren advocated against XControls (just the Xnodes as mentioned) but there is this post from 2017 where he recommends against XControls:

 

https://forums.ni.com/t5/LabVIEW/XControls-Can-I-use-them-or-will-I-hate-myself-later/m-p/3613946/hi...

Message 4 of 7
(192 Views)

I generally don't have problems with XControls.

However they don't play well with LVOOP.

Putting objects, or references to objects inside an XControl is a recipe for big headaches.

Message 5 of 7
(173 Views)

@Kyle97330 wrote:

I don't know about a video where Darren advocated against XControls (just the Xnodes as mentioned) but there is this post from 2017 where he recommends against XControls:

 

https://forums.ni.com/t5/LabVIEW/XControls-Can-I-use-them-or-will-I-hate-myself-later/m-p/3613946/hi...


Maybe i've just equated them in my head ...

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 7
(76 Views)

My list of problems with XControls

 

1. XControls

Message 7 of 7
(70 Views)