LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

code commenting feature request

Hello,
It seems like it sure would be neat to be able to highlight, or box around with a raised box, or other visual means to highlight a section of code in the diagram and comment it.  Right now, I am just using comment text block with number designators and descriptive text, then I pepper numbers all over the code requiring referring back to the comment code block.  The problem is the numbers don't really tell exactly what code the comment refers to, but it does a rough job just by the fact it is geographically close to the code that is being commented. 
It seems like this would just be another palette similar to what the front panel has to isolate front panel controls and decorate it, but with the ability to associate comment text.  Is there  something like this already I am just missing?

David Jenkinson
0 Kudos
Message 1 of 20
(4,234 Views)
There is a flat frame decoration that you can use on the block diagram. Structures -> Decorations -> Flat Frame. Is this what you were thinking of?
Message 2 of 20
(4,223 Views)

Most of the decorations are'nt very useful but if you select them on the FP and drop them on the BD you can use them.

Ben



Message Edited by Ben on 08-04-2008 06:40 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 20
(4,213 Views)
hmm ya I guess that's kind of what I meant.  Didn't notice that before.  Been using LV since 4.1, when did that happen?

Thanks
0 Kudos
Message 4 of 20
(4,196 Views)


Ben wrote:

Most of the decorations aren't very useful but if you select them on the FP and drop them on the BD you can use them.



You can also get to the decorations from the Programming palette in the BD by way of Structures then Decorations.  At least in LV 8.5.  It saves switching over to the FP then back. Smiley Wink


Message Edited by Ravens Fan on 08-04-2008 10:42 PM
Message 5 of 20
(4,187 Views)

The problem with the function palettes decorations is that there is less of them (although you do have the arrows).

Generally, for something like this, a visit to the Product Suggestion Center helps better.

As an alternative, create a VI with a string constant, make it large enough and color it in a prominent color (or use a LabVIEW class constant, if you want a specific design). You can now make a merge VI out of it and drop it whereever you want. After you drop it, you can edit the constant's description property, which will appear in the context help menu.


___________________
Try to take over the world!
0 Kudos
Message 6 of 20
(4,173 Views)


tst wrote:

The problem with the function palettes decorations is that there is less of them (although you do have the arrows).


You're right.  Putting decorations on the block diagram is something I've done very rarely, but I had done it recently and realized it was there.  Pretty much just to point out something in a block diagram for a reply to someone's message in the forum.  And it seems like the BD decorations pallette as all that you would need for that (labels, boxes, arrows and lines.)  The extra stuff in the FP decorations pallette is good for adding graphic features to a front panel, but probably have no real use for documenting a block diagram.
0 Kudos
Message 7 of 20
(4,147 Views)
One could also surround the code with a single frame sequence structure and then set the structures label to visible and comment using that.  (I usually do a single line comment on my loops this way.)
Jon D
Certified LabVIEW Developer.
0 Kudos
Message 8 of 20
(4,140 Views)
I still can't help but think it would be nice to have a dedicated "comment" frame, that had text tied to it, maybe dockable to whatever side you want, rather than separate from the frame.  Being separate from the frame lends itself to possibly getting unintentionally moved away from the frame it refers to.  It could perhaps be half opaque, as to not be too intrusive to the diagram logic itself, but enough to know it is there so that when you click it becomes complete opaque and readable.  The frame/arrow thing seems kind of clunky to me.  Proper commenting is something I've come to grips with in the last couple years, so I do a fair amount, and the way it is now just seems lacking somehow.

Dave
0 Kudos
Message 9 of 20
(4,113 Views)

The label (as Jon mentioned) is associated with the structure and labeling while loops, for instance, is reasonably common. You can manipulate the label to look nicer.

As for the suggestion I gave earlier, here's an example implementation (7.0). If you add this VI to your palettes as a merge VI, you can then drop it and right click it to edit the description property, which will appear in the help window.


___________________
Try to take over the world!
0 Kudos
Message 10 of 20
(4,102 Views)