From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comment code

Is there a way to put a comment box around a piece of code. e.i. if I
modify a small portion of a vi and want the next programmer to see exactly
where I made my changes I can add a comment but, I would like to surround
the entire change. Any ideas.

Thanks,
mickey
Message 1 of 12
(21,205 Views)
You can enter your comments directly on the diagram window by clicking on the 'whitespace' of the diagram with the 'edit text' cursor selected and then input your comments. Afterwards, you can resize the comment box by dragging a corner of it with the 'position/size/select' cursor selected, shade it with the 'set color' cursor and relegate it to the background by using the 'reorder' tools on the menu bar.
0 Kudos
Message 2 of 12
(21,205 Views)
Sorry, I spoke to soon. That doesn't work as the comment box does not move behind the data flow lines and continues to obscure them. Excuse me.
0 Kudos
Message 3 of 12
(21,205 Views)
Spaz wrote in news:5065000000050000008C6E0000-
1017707437000@exchange.ni.com:

> Sorry, I spoke to soon. That doesn't work as the comment box does not
> move behind the data flow lines and continues to obscure them. Excuse
> me.

If you set the bacgkground of the comment box transparent it works,
(remember to set the foreground color to black or another color or the
frame will disappear) but then again, it's not possible to make a fancy
background color.
0 Kudos
Message 9 of 12
(21,205 Views)
Yes you can see the wires but you can't select them to move or edit them. They are still *under* the comment box.


LabVIEW, C'est LabVIEW

0 Kudos
Message 10 of 12
(21,205 Views)
Jean-Pierre Drolet wrote in news:506500000005000000A86E0000-
1017707437000@exchange.ni.com:

> Yes you can see the wires but you can't select them to move or edit
> them. They are still *under* the comment box.

You are correct:

A comment box with transparent background will show wires but it is not
possible to select them.

but:
I get the same behaviour when using decorations copied from the front panel

(Labview 6.0.2)

Regards
Rolf
0 Kudos
Message 11 of 12
(20,952 Views)
You are right. Then we can only use frame decoration to enclose code and keeping the wire edition functional. I wonder why wires are forcedd to be below any other object on the diagram.


LabVIEW, C'est LabVIEW

0 Kudos
Message 12 of 12
(20,952 Views)
The only problem that prevents this technique to be really useful is that the comment box hides the wires beneath it even when put in background.

Another option is to copy a box (made transparent)or a frame from the front panel decoration menu and resize it to enclose your code snippets.


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 12
(21,205 Views)
Jean-Pierre-

You are brilliant (as always). I never new you could put front panel decorations on the diagram. Many times I have wished for an arrow decoration on the diagram. If your front panel is smaller than your diagram page you can actually drop the decoration straight onto the diagram once you have picked it from the front panel controls toolbox. Do you think this is 'issue free' as far as app builder, version recompiling or VI server functionality?

It seems that the old style frame decoration would be his best choice as it would give the thickest border that is colorable.

It seems that another posssibility that would allow for a colored background without obscuring the wires is to use a sequence structure without adding any additio
nal frames. I'm not sure if this would be issue free in terms of performance and all possibilities of diagram wiring.

Thanks for your input.
0 Kudos
Message 5 of 12
(21,205 Views)
*blush*

Spaz,

I am not aware of any issue when copying pictures and decorations on the diagram. For the application builder, VIs diagrams are removed so any picture within vanishes in the virtual void.

The sequence works too but it is very thick. You must state that the structure is solely for comment purposes because it is usually used for coding. Otherwise, sequences have no performance issues: they force execution order on the compiler but the code execute at the same speed.


LabVIEW, C'est LabVIEW

0 Kudos
Message 6 of 12
(21,205 Views)