LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vi snippet changes local variable to reference+value property node

Hello LV users,

 

Edit: using LV 2009 ofc

 

I noticed that when taking a snippet of the following code (see picture 1), LabVIEW transforms the local variable to a reference+value property node (see picture 2 - snippet)

Is this linked with the mechanical action (all of them are not compatible with locals) ? Is there any reason that makes the tool work this way ?

 

Picture 1 - simple code with local

 

 Vi with local.jpg

 

Picture 2 - snippet of the image above

 

after snippet.png

 

Regards,

Message Edited by Mathieu Steiner on 08-13-2009 05:20 PM
Message 1 of 19
(4,974 Views)

Matt-

 

I'm thinking that this is actually a benefit.  Certainly the property node executes more effeciently.  I'm curious about the mechanical action of the boolean though.  Does the snippet transfer work the same for switch and latch booleans?  If so this may be a bug breaking code snippets


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 19
(4,949 Views)

I can't confirm that behaviour but it looks like a bug. Doesn't LV convert locals to that code construct when we select a local and do a "create sub-VI"?

 

In general its not good because locals have better performance and does not force a UI thread switch.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 19
(4,947 Views)

Jeff Bohrer wrote:
Does the snippet transfer work the same for switch and latch booleans?  If so this may be a bug breaking code snippets

Jeff, Ben,

 

I can't manage to make it work.

 

The reason why is that with any of the latch mechanical actions, the VI is broken.

With such a broken VI, I can't get any snippet from the code, it just doesn't bring any window up when going to "Edit >> Create VI snippet from selection".

 

I tried with another broken VI not using local with latch mechanical action, and I manage to get a snippet from a broken piece of code.

So that it seems to be linked with the mechanical action.

 

Regards,
Message Edited by Mathieu Steiner on 08-13-2009 06:32 PM
0 Kudos
Message 4 of 19
(4,924 Views)
Well it sounds like a bug if it breaks snippets with latching booleans.  Thanks for the investigation.

"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 19
(4,894 Views)

Jeff Bohrer wrote:
Well it sounds like a bug if it breaks snippets with latching booleans

I think NI will show some insterest in the question and tell us if it's a feature or a bug Smiley Happy

 

Regards,

0 Kudos
Message 6 of 19
(4,866 Views)

Mathieu Steiner wrote:

I think NI will show some insterest in the question and tell us if it's a feature or a bug Smiley Happy

 

Regards,


Noone from NI to confirm/explain ?

 

Regards,

0 Kudos
Message 7 of 19
(4,832 Views)

Hi Mathieu

 

I got the same behavior as you did. I created a Corrective Action Report (#183315) for this. Will post the findings as soon as I know. Thank you for bringing this to our attention.

 

Best Regards

 

David

NISW

Message 8 of 19
(4,816 Views)

I was trying to post a VI snippet in this message.  The snippet and the VI it was derived from is attached in the same message.

 

The conversion to references on the controls happened to me as well.  But there was one other problem.

 

When I dropped the snippet back into a blank VI, the controls that were present were out of order.  Instead of having the string on top and being within page 1.  It was on the bottom underneath the entire tab control.  It looked like it was missing.  When I found it and reordered the string control and put it on top, it did that, but it was actually on top of the tab control and not within page 1 like it originally was  I had to drag it off and drag it back in to get the VI's front panel back to normal.

 

It was like the VI snipped reversed the Z-order of the controls and caused it to lose the fact it was part of the page 1 container.

Message 9 of 19
(4,714 Views)

David,

 

I have not found any case where a snippet that used property nodes worked!

 

Take a look at this thread where I resorted to posting an image plus code since it was impossible to produce a snippet the would work right!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 19
(4,669 Views)