LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nasty LV Quirk

Here's a really nasty LabVIEW Quirk:

  1. Create a custom control whose type is set to "TypeDef."
  2. Place it on a VI's front panel.
  3. Create a property node for that control
  4. Save and close the VI
  5. Change the custom control's type from "TypeDef" to "Control"
  6. Reopen the VI.  The control will still be there, but the property node will be gone.
"If you weren't supposed to push it, it wouldn't be a button."
Message 1 of 15
(2,442 Views)

.Reproduced in LV20, 64 bit...

 


@paul_cardinale wrote:

4. Save and close the VI


This asked to save the type def as well, as I didn't save it before (as this wasn't instructed 😁). It still reproduced though.

Message 2 of 15
(2,433 Views)

LV 2016 also.  I believe that, since the property node is an implicit one, LabVIEW thinks you just deleted the control so the implicit property disappears along with it.  I guess the typedef doesn't get "apply changes" to the control, so the implicit property node is orphaned and gets deleted.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 15
(2,362 Views)

You can even see it in real time.  Leave the VI open and change the typedef to a control (and apply changes).  The property node disappears before your very eyes - POOF! - it's gone.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 15
(2,338 Views)

Interesting edge case. I have never felt the need to convert a typedef back to a control.

 

Typically I would just "right-click...disconnect from typedef" and the property node is retained.

Message 5 of 15
(2,333 Views)

@altenbach wrote:

Interesting edge case. I have never felt the need to convert a typedef back to a control.

 

Typically I would just "right-click...disconnect from typedef" and the property node is retained.


We have a lot of custom buttons that always should have been controls instead of typedefs.  The link is unnecessary and just creates extra stuff on our deployments.  I switched them from controls to typedefs then lots of stuff broke.  I'm trying to think of a way to fix things without going back to typedefs; so far no luck.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 15
(2,321 Views)

How about finding each instance and disconnecting it?  Then, only after all the typedefs have been disconnected, make the typdef a control?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 15
(2,313 Views)

I found that this will fix a VI, if it hasn't been opened:
fix.png
But this code makes some assumptions that may not be true.  I'll have to refine it before I shotgun our code.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 15
(2,306 Views)

On second thought, I'll probably do something like this:

  1. Make sure the test engineers have their latest code checked in.
  2. Revert the buttons back to the typedef'd versions
  3. Write and run a script that:
    1. Scans all our code for instances of those buttons
    2. Checks out the owning VIs
    3. Disconnects the typdefs
    4. Checks in the the VIs
  4. Unrevert the buttons to the non-typedef's version.
  5. Tell the test engineers to sync.
"If you weren't supposed to push it, it wouldn't be a button."
Message 9 of 15
(2,296 Views)

@paul_cardinale wrote:

On second thought, I'll probably do something like this:

  1. Make sure the test engineers have their latest code checked in.
  2. Revert the buttons back to the typedef'd versions
  3. Write and run a script that:
    1. Scans all our code for instances of those buttons
    2. Checks out the owning VIs
    3. Disconnects the typdefs
    4. Checks in the the VIs
  4. Unrevert the buttons to the non-typedef's version.
  5. Tell the test engineers to sync.

Oh, gosh - so kind of what I suggested on a grand scale... whew!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 15
(2,270 Views)