12-07-2009 02:52 PM
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:
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:
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.
12-07-2009 02:57 PM
12-07-2009 02:58 PM
12-07-2009 03:13 PM
Comments? What are these "comments" things you speak of?
12-08-2009 01:46 AM
Hu Gleichman,
Comments means documenting your code in the code
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
12-08-2009 03:48 AM - edited 12-08-2009 03:56 AM
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!
Original posted 2003 🙂
http://forums.ni.com/ni/board/message?board.id=170&message.id=65487&query.id=1154702#M65487
12-08-2009 07:47 AM
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.
12-08-2009 07:50 AM
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?
12-08-2009 08:33 AM
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
12-09-2009 09:43 AM
falkpl wrote:Is there anyway to make the picture comment linked to the find feature?