08-13-2009 10:19 AM - edited 08-13-2009 10:20 AM
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
Picture 2 - snippet of the image above
Regards,
08-13-2009 11:09 AM
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
08-13-2009 11:13 AM
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
08-13-2009 11:31 AM - edited 08-13-2009 11:32 AM
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,
08-14-2009 09:11 AM
08-17-2009 01:36 AM
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
Regards,
08-19-2009 04:33 AM
Mathieu Steiner wrote:I think NI will show some insterest in the question and tell us if it's a feature or a bug
Regards,
Noone from NI to confirm/explain ?
Regards,
08-19-2009 06:04 AM
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
08-27-2009 09:22 PM
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.
09-01-2009 08:12 AM
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