LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a difference between the X and Y input parameters of a "=" comparison?

Hello,

In the attached Vi, if I switch the input parameters of the equal comparison, the Vi compiles. Otherwise it shows the class conflict error.

In the real system, I just switched between the parameters and everything worked fine but I'd like to know why this version is wrong so next time I don't waste so much time debugging.

Thanks,

Marce
0 Kudos
Message 1 of 4
(2,795 Views)
It looks like you dropped a refnum from the front panel palette and then set the type to boolean; this created a weak-typed refnem. To make a strong typed refnum, right click on the control and select create reference; a reference appears on the block diagram. Go to the reference and right click create control. The reference control on the front panel now has the orange star indicating that it is strong typed.

I don't know why equals behaves the way it does with weak-typed references. You might also experiment with the equals operator on the Express palette.
Message 2 of 4
(2,787 Views)
Hi,

I'm sure I did create the reference from the control because I always do it that way. But I don't remeber what else happened since then. It's the first time I see the orange star. I'd appreciate if you can give me a pointer to articles on that issue, strong-typed references and so on.

Thanks again,

Marce
0 Kudos
Message 3 of 4
(2,768 Views)
Marce,

Below you will find a link to a KB that explains strictly/weakly typed refnums in a way that is applicable to your situation. In the case of the refnum comparison, the X case defines which instance of the polymorphic VI is used. A strictly typed refnum can be connected to a weakly typed terminal, but not vice versa, so this explains the behavior you are seeing. Hope this helps clarify!

http://digital.ni.com/public.nsf/websearch/B78B0959B7CD6EB1862569370068ECBE?OpenDocument

Regards,
E. Sulzer
Applications Engineer
National Instruments
Message 4 of 4
(2,748 Views)