LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disabled Node Coercion Issue

Solved!
Go to solution

Hi all,

 

A really pedantic issue as the code works fine, however its been annoying me for a while now. Smiley LOL 

 

When trying to "Disable and grey out" a numeric indicator using the "Disabled" property node, I seem to be getting a coercion dot and I'm not quite sure why. 
Using the contextual help as a guide, it explains the node takes an "Unsigned 8-bit byte integer". Which is what I've converted my input to, however it seems LabView is still unhappy and changes the data representation to something else, hence the coercion dot appearing. 

 

Very puzzled at the moment, I've been trying to work this out on my own for an embarrassingly long amount of time, so any help would be really appreciated, thanks!

 

I've included a very simple image showing what I mean.

0 Kudos
Message 1 of 8
(2,494 Views)

Hi,

 

that property node expects an enum value, so to remove that coercion dot you need to wire the correct enum…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(2,490 Views)
Solution
Accepted by topic author pete5544

It used to be a plain u8, but it got changed to an enum.

 

I can't find where it states the value is an U8. But if it is there somewhere, I guess they forgot to change it.

 

My help says:

Values

0 Enabled—The user can operate the object.
1 Disabled—The object appears as normal on the front panel, but the user cannot operate the object.
2 Disabled and Grayed Out—The object appears dimmed on the front panel, and the user cannot operate the object.

 

Right click and create a constant to get the correct enum.

Message 3 of 8
(2,474 Views)

Thanks, worked a charm. 🙂

 

0 Kudos
Message 4 of 8
(2,465 Views)
  • Yes, to get the correct input, right-click ... create {control | constant | indicator} is always the best way.
  • The help and context help show that blue icon with the two triangles (picture). That's an enum. A numeric U8 would show a blue "U8".
  • (On a related topic, your image shows the Rube Goldberg way to create a U8 input. The correct way would be to right-click the numeric and simply change the representation 😄 No conversion needed...)
  • That coercion dot does not cause any problems, just code readability issues. Coercion dots are not always bad.

 

 

disabled.png

Message 5 of 8
(2,427 Views)

FWIW, I often intentionally do the same kind of explicit type conversion after an integer constant as pete5544 showed in the screencap.   I find it helpful for self-documenting the bitness of that particular integer. 

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 8
(2,418 Views)

@Kevin_Price wrote:

I find it helpful for self-documenting the bitness of that particular integer


I typically just show the label of the diagram constant and describe the type. ("U16", "2D DBL Array", etc.)

Message 7 of 8
(2,412 Views)

I used to use a label too, but eventually realized that strategy is best reserved for those who are more diligent than I at keeping code, labels, and comments in perfect sync.  Especially during the later stages of debugging against a looming deadline.  Smiley Tongue

 

The conversion function won't lie to me the way my own labels and comments have occasionally been known to...

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 8 of 8
(2,386 Views)