LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 12/07/2009

We all know that it's considered good style to comment our diagrams to enhance their readability and maintainability.  But have you ever considered using images to help comment your diagrams?  You can place images on your VI panels and diagrams when a picture will more easily convey information than a text comment.  For example, here's the diagram from a math example that ships with LabVIEW:

 

formula_comment.png

 

The image helps us better understand the mathematical formula at work in this LabVIEW code.  In another example, we have an image of a state diagram that helps us understand the different transitions in a standard LabVIEW state machine:

 

state_diagram.png

 

If you want to place images on your LabVIEW front panels or block diagrams, it's as simple as copy/pasting them from the clipboard, just like you would in most other environments.

Message 1 of 15
(8,605 Views)
This feature is one of the most endearing qualities of LabVIEW when compared to the editors in other languages. Be careful to not paste BMP files - your VI file size can get huge. Best to keep it PNG, GIF, JPG.
Richard






Message 2 of 15
(8,601 Views)
Good tip about avoiding BMP files...thanks for sharing.
0 Kudos
Message 3 of 15
(8,595 Views)

Comments? What are these "comments" things you speak of?

Message 4 of 15
(8,568 Views)

Hu Gleichman,

 

 

Comments means documenting your code in the code  Smiley Wink

 

It is all about good programming practices and documenting your code. You can use text and images as well to document your code. Images are well suitable when you document your algorithm, for example.

 

 

I believe that this information is taken from LabVIEW Intermediate I course, which I found to be one of the best to take if you seriously work in LabVIEW.

 

 

Regards,

Stefo

Certified-LabVIEW-Developer_rgb.jpg

0 Kudos
Message 5 of 15
(8,479 Views)

The first time I saw such a way of documentation is about 5 or 6 (+?) years back in a vi from wha@atmel .

The picture is big but only 46kB 🙂 I just opened the main blockdiagram without the (very old) portIO vis. 

It's more than only documentation.  Kudos belong to wha@atmel!

 

 

vi documentation.png

Original posted  2003 🙂

http://forums.ni.com/ni/board/message?board.id=170&message.id=65487&query.id=1154702#M65487

Message Edited by Henrik Volkers on 12-08-2009 10:56 AM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 6 of 15
(8,451 Views)

Short comment on image types:

 

BMP - uncompressed image.  Only good use case is for ancient readers which cannot handle anything else

GIF - old format, limited to 256 colors, uses lossless compression.  Has been superceded by PNG.  Only good use case is for readers which cannot handle PNG.

PNG - relatively new format designed to replace GIF and not have patent encumbrances (GIF did at one point).  Uses lossless compression.  Excellent for line drawings, such as most LabVIEW diagrams and the documentation Darren mentioned above.  Preferred format for posting LabVIEW screenshots.  Use highest compression in most cases.

JPG -  format used for photographs.  Uses lossy compression. This compression produces fuzziness and halos around sharp edges such as text and lines, making this format largely unsuitable for line drawings or LabVIEW screenshots.  Use only for photos, where it is the format of choice, unless you are doing image analysis.

TIF - the grandfather of all formats.  More options and compression schemes than you might think.  I am not sure if any piece of software fully implements this standard.  Can be used for anything, with the appropriate settings.  It is widely supported with professional software, but not consumer software.  PNG or JPG will usually give better results in this forum.

 

Take home message, use PNG for almost all LabVIEW documentation or screenshots you post to this forum.

Message 7 of 15
(8,405 Views)

Nice Tip really shows the power of graphical programming!

The only disadvantage of using a picture is that it is not searchable.  I like to add text sometimes so I can later use the labview find to find a comment (nice for when using multi-programmers ie put my initials on a bugfix or a todo note on the block diagram).  Still the picture is more powerful in many situations.  Is there anyway to make the picture comment linked to the find feature?

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 15
(8,400 Views)

Yes! using images as documentation is great.

 

This link (does not work for everyone don't know why) lets you browse into an app I did years ago (String driven cases strutures were all the rage back then) and included diagrams to make it easy to follow the flow.

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 15
(8,378 Views)

falkpl wrote:

  Is there anyway to make the picture comment linked to the find feature?


 

One thing you could try is typing some keywords into a free label and put it behind your image.  A search for the keywords should bring you to the image.  Maybe someday LV will be able to search for metadata in pasted images and we could use proper keywords.
 
 
0 Kudos
Message 10 of 15
(8,272 Views)