{"id":19584,"date":"2017-03-15T10:00:32","date_gmt":"2017-03-15T17:00:32","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=19584"},"modified":"2021-06-11T10:39:09","modified_gmt":"2021-06-11T17:39:09","slug":"tricks-to-help-you-increase-your-labview-coding-speed","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/tricks-to-help-you-increase-your-labview-coding-speed\/","title":{"rendered":"Tricks to Help You Increase Your LabVIEW Coding Speed"},"content":{"rendered":"<p>The\u00a0<a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW<\/a> environment is full of features\u00a0but can be overwhelming at first. When I first started using LabVIEW, I was very frustrated with the amount of time I had to spend to do just about anything. I remember wasting time searching through the functions\u00a0palette\u00a0trying to find a block I had used the previous day. Every so often I would have a Eureka! moment where I learn something that\u00a0helped me speed up my coding process. In this blog\u00a0post, I will tell you about some of the tricks I&#8217;ve learned, and hopefully, they will help you avoid some of my frustrations.<\/p>\n<p><strong>Diagram Disable Structure\u00a0<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-19589 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.01.14-PM-600x208.png\" alt=\"\" width=\"600\" height=\"208\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.01.14-PM-600x208.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.01.14-PM.png 654w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Nothing is worse than those moments when you delete your old code because you think you&#8217;ve made found a better way to\u00a0do it but later find\u00a0out you had it right the first time. The Diagram Disable Structure can help you avoid this issue. It is an effective tool within <a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW <\/a>because it allows a user to run their\u00a0code, even if it is partially broken. This is a useful tool used for debugging new code, or if a user is looking to add improvements to the current code, without affecting the original program.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-19590 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.01.36-PM-600x207.png\" alt=\"\" width=\"600\" height=\"207\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.01.36-PM-600x207.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.01.36-PM.png 654w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Hotkeys<\/strong><\/p>\n<p><a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW<\/a> has a lot of hotkeys that can help you speed up the coding process. Below are the hotkeys that I use the most, for a full list of hotkeys check out this <a href=\"http:\/\/zone.ni.com\/reference\/en-XX\/help\/371361L-01\/lvhowto\/keyboard_shortcuts\/\">link<\/a>.<\/p>\n<ul>\n<li>Ctrl + Space &#8211; Opens the quick drop menu<\/li>\n<li>Ctrl + E &#8211; Switches between front panel and Block Diagram<\/li>\n<li>Ctrl\u00a0+ B &#8211; Deletes\u00a0loose wires<\/li>\n<li>Ctrl\u00a0+ U &#8211; Reroutes wires and rearranges objects in a\u00a0selected area<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-19591 size-medium aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.18.00-PM-e1489433214661-600x430.png\" alt=\"\" width=\"600\" height=\"430\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.18.00-PM-e1489433214661-600x430.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.18.00-PM-e1489433214661-768x550.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.18.00-PM-e1489433214661.png 811w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>It is also possible to view the keyboard shortcuts and change them. The list can be found by going to\u00a0<strong>Tools &gt;&gt; Options &gt;&gt; Menu Shortcuts.\u00a0<\/strong><\/p>\n<p><strong>Shift Registers<\/strong><\/p>\n<p><a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW<\/a> includes an easy way to pass data from one loop to the next when using a while loop. Shift registers can be added to the diagram by right-clicking on the while loop structure and clicking &#8216;add shift register.&#8217; Wiring a value into the left shift register from outside the loop will initialize the shift register.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19592 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/nlnkkqjj48134.jpg\" alt=\"\" width=\"361\" height=\"237\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/nlnkkqjj48134.jpg 361w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/nlnkkqjj48134-214x140.jpg 214w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/p>\n<p>In many instances, you will want to pass values in and out of a while loop. Values can be wired through the borders of the loop. Values wired in from the left side are inputs into the loop, and wires exiting the right side are outputs. Code that is connected to the output side of a while loop will not execute until the while loop has completed.<\/p>\n<p><strong>Local Variables<\/strong><\/p>\n<p>A local variable can read or write to controls or indicators on the front panel of a VI. Local variables are useful to communicate between structures within one VI. To create\u00a0a local variable on the\u00a0diagram, right-click an existing front panel object or block diagram terminal and select\u00a0<strong>Create\u00bbLocal Variable<\/strong>\u00a0from the shortcut menu to create a local variable that you can add to the block diagram.<\/p>\n<div class=\"page\" title=\"Page 3\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19593 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.36.26-PM.png\" alt=\"\" width=\"426\" height=\"217\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Thank you for reading my blog post, and for more LabVIEW tips and tricks follow this\u00a0<a href=\"http:\/\/www.ni.com\/tutorial\/14131\/en\/\">link<\/a>. If you are interested in trying out LabVIEW for yourself, you can purchase a copy of\u00a0<a href=\"https:\/\/digilent.com\/shop\/labview-home-bundle\/\">LabVIEW 2014 Home Edition<\/a>\u00a0which includes everything you will need to run\u00a0<a href=\"https:\/\/www.labviewmakerhub.com\/doku.php?id=learn:tutorials:libraries:linx:3-0:beaglebone-black-setup\">LINX 3.0<\/a>.\u00a0Please comment below with any questions or comments you may have.<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-19584 jlk' data-task='like' data-post_id='19584' data-nonce='d8c4d58d14' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-19584 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-19584 jlk' data-task='unlike' data-post_id='19584' data-nonce='d8c4d58d14' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-19584 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-19584 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Learn some handy tips and tricks to elevate from being in the LabVIEW know, to being a LabVIEW pro!<\/p>\n","protected":false},"author":42,"featured_media":19593,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4323,1563],"tags":[],"ppma_author":[4493],"class_list":["post-19584","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-13-at-12.36.26-PM.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4493,"user_id":42,"is_guest":0,"slug":"astanton","display_name":"Austin Stanton","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/0cc9db2caf6344c8f78ea46c21570f33a954c45596addf479125043e52431de0?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/19584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=19584"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/19584\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/19593"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=19584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=19584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=19584"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=19584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}