LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Am I commenting wrong?

Solved!
Go to solution

billko wrote:

I've always used structure labels to comment.  On this machine, I have LabVIEW 7.1.  You just have to make the label visible.  Or is this handled in a better way in LV 2012?  Thanks!


Yes, you still have to make structure labels visible via the right-click menu.  In 2012, they added the Subdiagram labels, which Jeff has so eloquently shown.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 22
(1,062 Views)

I appreciate you guys' frank answers (Yes, that's wrong) but maybe I ask more exact questions -

 

Does the diagram disable structure make non-obvious changes to execution, such as forcing items in the enabled portion to execute around the same time the way the frame structure does? 

 

Is the enable/disable operation determined at run time or compile time?

 

Is a formula node with no inputs/outputs visible at run time?

 

Is the text inside a formula node stored in some way that is less efficient than that in a free text label?

 

(And just to be defensive - the primary benefit of the formula node over the free text label is the scroll bar)

 

0 Kudos
Message 12 of 22
(1,041 Views)

What about a string constant?  You can set the scroll bar to visible. You can have some "style," such as different sizes, bold, underline, and others.

 

Lynn

0 Kudos
Message 13 of 22
(1,038 Views)

@fborlc wrote:

I appreciate you guys' frank answers (Yes, that's wrong) but maybe I ask more exact questions -

 

Does the diagram disable structure make non-obvious changes to execution, such as forcing items in the enabled portion to execute around the same time the way the frame structure does? yes

 

Is the enable/disable operation determined at run time or compile time? edit/compile

 

Is a formula node with no inputs/outputs visible at run time? not sure what you are looking for with this.  While a VI is running in the IDE, you can look at any part of the code

 

Is the text inside a formula node stored in some way that is less efficient than that in a free text label? there is the overhead of the formula node itself

 

(And just to be defensive - the primary benefit of the formula node over the free text label is the scroll bar) As noted, use a string constant

 


 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 14 of 22
(1,032 Views)

@crossrulz wrote:

Is a formula node with no inputs/outputs visible at run time? not sure what you are looking for with this.  While a VI is running in the IDE, you can look at any part of the code

 

Is the text inside a formula node stored in some way that is less efficient than that in a free text label? there is the overhead of the formula node itself

 

(And just to be defensive - the primary benefit of the formula node over the free text label is the scroll bar) As noted, use a string constant


Thank you, crossrulz

 

If a formula node has no I/O, is it ever actually called? If I make an executable will it take up space?

0 Kudos
Message 15 of 22
(1,018 Views)

@fborlc wrote:

If a formula node has no I/O, is it ever actually called? If I make an executable will it take up space?

Technically, since it is in the disabled subdiagram, it won't even be looked at for compiling.  But it does use up code space.

 

Even still, I would hate to have to toggle a case in order to figure out what the code is doing and then switching back to verify the comment matches the code.  I'd much rather have it all right there in front of me.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 22
(1,003 Views)

@crossrulz wrote:

@fborlc wrote:

If a formula node has no I/O, is it ever actually called? If I make an executable will it take up space?

Technically, since it is in the disabled subdiagram, it won't even be looked at for compiling.  But it does use up code space.

 

Even still, I would hate to have to toggle a case in order to figure out what the code is doing and then switching back to verify the comment matches the code.  I'd much rather have it all right there in front of me.


I think we are needlessly re-inventing the wheel.  Make a free label, then use decorations (like arrows or frames) if you need to clarify.  If you're like, me, the fewer the distractions, the better.  I'd concentrate on toggling between comment and code, and by then my i/o buffer has been overwritten.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 17 of 22
(998 Views)

BTW, you should check out this idea on the Idea Exchange:Advanced Code Commenting Functionality


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 18 of 22
(988 Views)
Solution
Accepted by fborlc

fborlc wrote:


If a formula node has no I/O, is it ever actually called? If I make an executable will it take up space?
In an executable with debugging disabled and block diagrams removed that would depend entirely on the version of LabVIEW you are using.  The 2010 - 2012 compillers should be able to optomize the code to completely remove the unreachable code.  In fact, the unreachable code will not be in the compiled code at all so there is no hit to the vi object only the source code will be impacted.  2009 may remove unreachable code.  8.6.1 and earlier will not.  Future versions I will not predict  and are subject to change this behavior for any reason. 
 
FOR THAT VERY REASON, behavior dependant on LabVIEW version, I strongly urge you to discontinue this practice for commenting code.  some day it might come back and bite you in a big way.Smiley Surprised

"Should be" isn't "Is" -Jay
Message 19 of 22
(980 Views)

Thanks for the clear answer, Jeff. I will use string constants instead for my long comments.

0 Kudos
Message 20 of 22
(974 Views)