Three Steps to Develop Good LabVIEW Programming Habits

Publisher:ping777Latest update time:2015-10-21 Source: eefocusKeywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Part 1~ VI
  1. Place the VIs in a systematic manner. You can use folders to manage subVIs or save subVIs as LLB files.
  2. Do not save too many VIs to LLB files, because it will take more time to save VIs to LLB files later.
  3. Use Tools»Edit VI Library to set the top VI in the LLB. Usually the main program is set as the top VI, so that it is easier to find the main program next time you want to open it.
  4. If a subVI you developed is often used as a subVI by other VIs, you may want to create a .mnu file and put this subVI in "Functions»All Functions»User Libraries" so that you will find it easier next time.
  5. Give your VI a meaningful file name! Don't always call it test1.vi or test2.vi. If you do this, it will be difficult to know the program content from the file name. In addition, avoid illegal characters in the file name, such as backslash (), slash (/), colon (:), etc.
  6. Use standard extensions, such as *.vi, *.ctl.
  7. If the file name is in English, please capitalize the first letter (develop a good habit).
  8. Write a description of this VI in Files » VI Properties » Documentation. You are the author, and no one should know the Vi you wrote better than you.
  9. In the VI Description, include your name and company name.
  10. If you modify your VI, try using the History window to keep a log of every modification you make. The History window is located at: Files » VI Properties » General.
  11. Draw a meaningful icon so that the next time you see the icon, you can immediately know the function and purpose of this VI.
  12. Please do not exceed 16 points for the icon.
  13. Store the VIs you use for testing in a separate folder so that you can use them next time.
  14. Test your VI in more than one environment, such as Windows 2000, Windows XP, and screen resolutions of 800x600 or 1024x768. Make sure your VI works perfectly in each environment.

 

 

Part 2: Human-Machine Interface

  1. Give each control a meaningful name.
  2. Set the background of the name label to transparent.
  3. Please use a unified and systematic naming convention to name each control element.
  4. Use standard fonts. If you use special fonts, it may not be displayed perfectly on another computer.
  5. If possible, check "Size to Text" for each label.
  6. Set default values ​​for controls as appropriate.
  7. Add units to the name of the control element as appropriate, such as seconds, kilometers, etc.
  8. To add comments to a control, right-click on the control and select Description and Tips. If you copy a control, remember to modify the comments accordingly.
  9. Place controls and indicators in appropriate locations. For example, if it is the main VI, place the more important controls in the most prominent position; if it is a sub VI, place the controls on the left and the indicators on the right.
  10. Use the "Align Objects" and "Distribute Objects" functions to arrange control elements when appropriate, which can save you a lot of time.
  11. Do not overlap controls. If you have too many controls, you may want to use "Tab Control" to solve your problem.
  12. Use some colors appropriately to highlight some important control elements.
  13. Use the "error in" and "error out" functions where appropriate.
  14. Place a "Stop" button on the human-computer interface and use it frequently to stop the program. Try not to use the Abort button.
  15. Use ring controls (Controls » All Controls » Dialog Controls » Dialog Ring) and enumerated controls (Functions » All Functions » Numeric » Enum Constant) when appropriate. If you currently use Boolean controls to make true/false selections, consider using ring controls because you may need to make more than two selections in the future as your program expands. 

Three Steps ~ Program Block Diagram

  1. Avoid using too large an area in the program block diagram. If you use too large an area, you will have to move the scroll bar of the window to see the program content. Try to reduce the area of ​​your program block diagram. It is best to use an 800X600 screen or a 1027X768 screen to fully display your program block diagram. You will find that this can greatly save your time.
  2. Annotate the important objects in your program block diagram. You can add eye-catching annotations anywhere in the program block diagram at any time.
  3. Use standard fonts, not fancy ones.
  4. Check "Size to Text" for all labels.
  5. Reduce the spacing between all objects in the program block diagram to save space. But don't put all objects side by side or overlap them. There should be at least 3 pixels between them.
  6. The placement of objects in the program block diagram should be based on the actual running direction of the program, from left to right and from top to bottom.
  7. Use the "Align Objects" and "Distribute Objects" functions to arrange all the objects in the formula block diagram so that they look orderly.
  8. Make sure the connection lines appear on the white background. Do not cover the connection lines with objects.
  9. Make good use of your subVIs.
  10. Make sure your program can run smoothly when an error occurs, instead of popping up an error dialog box. Connecting the error out cluster can prevent the error dialog box from popping up when an error occurs.

Keywords:LabVIEW Reference address:Three Steps to Develop Good LabVIEW Programming Habits

Previous article:Labview serial port debugging
Next article:LabVIEW Basic Concepts

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号