LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

typedef coersion

Hi All,

Can someone explain to me why a value property node created from a reference from an enum does not retain the enum typdef.

To illustrate:

1) create a new typedef, save this as a control (stricy typedef)
2) drop this typedef into a VI as an indicator
3) right click on it, choose create constant, this works as expected, no coersion dots appear
4) right click on the indicator, create a reference
5) right click on the reference, change it to a control
6) from this control create a writable value property node
7) wire the original constant created in step 3 into the value, now coersion dots appear.

Why does creating a reference lose the association with the typedef? (If you create a constant from the value property node it is not a typdef)

Attached is a simple VI to show this




Message Edited by nrp on 05-16-2008 11:31 AM
Download All
0 Kudos
Message 1 of 8
(3,376 Views)
The only thing I can think of is that a strict-typedef is meant for FP items?

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 2 of 8
(3,358 Views)
It is not just the strict functionality I am worried about, it loses the typedef altogether so is no longer coupled with the original control, and I am sure you know what that means when it comes to maintaining a large project...
0 Kudos
Message 3 of 8
(3,341 Views)

I think the reason, for the coersion dot, is that Labview does not understand that the reference and the constand, come from the same type def.

I think there is no further problem in applications

0 Kudos
Message 4 of 8
(3,328 Views)
If you get the 'one' typdef in context help, we can see that it is defined as a typedef, when we get the context help for the property node, we can see that it is not defined as a typedef.

The reason there is the coersion dot is that the two data types do not match, with the constant both data types are I16, U16 so there is no coersion dot




Message Edited by yenknip on 05-16-2008 01:38 PM

Message Edited by yenknip on 05-16-2008 01:41 PM
_____________________________
- Cheers, Ed
0 Kudos
Message 5 of 8
(3,318 Views)
so the conclusion is that this is expected behaviour and there is no way to get rid of the coersion dots?
0 Kudos
Message 6 of 8
(3,304 Views)
I've been playing with it for the last half hour, but can't make the coersion dot go away. As you say, the property node doesn't seem to carry on the typedef. I think it's because you can't explicitly define a property node as a typedef.

Directly wiring and local variables = no dot
referencing = coersion dot
_____________________________
- Cheers, Ed
0 Kudos
Message 7 of 8
(3,299 Views)

Same question asked here a few years later...

0 Kudos
Message 8 of 8
(2,868 Views)