11-20-2018 05:50 AM
Hi all,
A really pedantic issue as the code works fine, however its been annoying me for a while now.
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.
Solved! Go to Solution.
11-20-2018 05:54 AM
11-20-2018 06:17 AM
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.
11-20-2018 07:07 AM
Thanks, worked a charm. 🙂
11-20-2018 11:14 AM
11-20-2018 12:27 PM
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
11-20-2018 12:34 PM
@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.)
11-21-2018 12:47 AM
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.
The conversion function won't lie to me the way my own labels and comments have occasionally been known to...
-Kevin P