LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why do I get this coercion dot?

I have a strict typedef switch-when-released bool button value change event, and the newval property goes straight into a select.
 
Why the coersion dot?  I also get it when I wire straight from the control terminal to the select.  Pause Button.ctl is in 8.5
0 Kudos
Message 1 of 9
(3,828 Views)
You are not the first to ask this question. See here and here.
0 Kudos
Message 2 of 9
(3,820 Views)
I think the select is not truly polymorphic and only accepts a boolean or error. So a (strict) typedef is casted into a boolean.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 9
(3,817 Views)
Thanks, guys.  I had also come to the conclusion that Type Defs include the fact that they're a typedef in their data, but I was wondering if anybody had a more in depth answer about why it's that way.  Either it's altering the data of a boolean to include the typdef flag, which will increase the filesize of a large typedef boolean array, or it's not included, in which case I don't know how LabVIEW can differentiate between typedefs and nons.
0 Kudos
Message 4 of 9
(3,814 Views)


@JeffOverton wrote:
[...] boolean to include the typdef flag, which will increase the filesize of a large typedef boolean array, [...]



Not neccessarily. Boolean has 1 Byte for in information which can be stored in a sinlge bit. So there is plenty of space left to store infos without enlarging the whole data.

But: i am not sure if it works like this, so don't count on it.... (so maybe you are correct....)

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 9
(3,806 Views)
Yeah, I'm just guessing here, and I don't have any giant boolean arrays, so this is more for curiosity's sake.
0 Kudos
Message 6 of 9
(3,800 Views)
Norbert I so hope you are wrong, The boolean True value is defined as '>0', so storing any info in the actual data will make all values true.
The typdef info is stored in the data-information about the pointer.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 9
(3,798 Views)


@TonP wrote:
[...]
The typdef info is stored in the data-information about the pointer.
[...]

That could be true as well. And if so, the size wouldn't increase too much either since the array has to contain elements of a single type so all elements share the type. So, in conclussion, the type has to be defined only once.
And regarding my "assumption": Well, it could be encapsulated in the boolean functions and work like masking the "boolean byte". So maybe one bit is not considered for the "!=0" decision....

just some thougths....
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 9
(3,792 Views)
It could even just be a flag bit that's stored at the end of the variable name dataspace.
0 Kudos
Message 9 of 9
(3,784 Views)