Talk:Tips and tricks

From LabVIEW Wiki
Jump to: navigation, search

Here are some questionable points which either require clarification or should be moved to different articles

  • To list multiple file types in a file dialog box using the File Dialog function or Open/Create/Replace File VI, wire a string constant or control to the pattern terminal and use semicolons to separate the patterns, for example fx*.bin;*.c.
    • This is too specific and documented behavior
  • Select File»VI Properties and select Editor Options from the Category pull-down menu to change the style of the control or indicator LabVIEW creates when you right-click a terminal and select Create»Control or Create»Indicator from the shortcut menu. Select Tools»Options and select Front Panel from the Category list to change the style of the control or indicator LabVIEW creates in new VIs when you right-click a terminal and select Create»Control or Create»Indicator from the shortcut menu.
    • This is too specific and documented behavior
  • If you have the autotool on, the mouse cursor changes to "the most needed tool on this region of the screen." Sometimes that means each tool gets only a small region of the screen. I hear people want to turn the autotool off when they try to move a boolean button -- they can get the operate tool and the text tool, but they can't find the very small region to get the pointer tool. Hit the control key. If you hold down the control key, it is defined to give you "the second most needed tool on this region of the screen."
    • I couldn't reproduce this behavior for the tools palette
  • To display percentage without explicit scaling, for example set the format to "%d %%" and the unit string to "cm/m". The controls stays unit-less but the displayed number is multiplied by 100 (100cm in 1 meter).
    • This doesn't seem to be related to numeric controls. Somebody enlighten me
  • For icon editing, you can drag a picture file or another VI's icon over (with the arrow tool) and automatically update the icon picture.
    • Don't know what this means
  • Toggle automatic wiring by pressing the spacebar while you drag an object onto the block diagram or move an object using the Positioning tool.
    • This doesn't seem to work for me. Clarification needed.
  • Short scripts work well with the Formula Node because the Formula Node executes faster than the MathScript Node.
    • Is this common knowledge, or is there any proof?
  • Use the Control Value:Get [Variant], Control Value:Set [Variant], and Control Value:Get All [Variant] methods to get and set control values to or from the LabVIEW variant data type. You do not have to flatten data or specify a type descriptor when you use these methods.
    • This is a bit too specific in my opinion
  • Enter single-step mode by clicking the Step Into or Step Over button on the block diagram toolbar. Move the cursor over the Step Into, Step Over, or Step Out button to view a tip strip that describes the next step if you click that button.
  • When you have selected Retain Wire Values and you place the cursor over a wire, a tip strip appears, that includes the value of the data in the wire.
  • To pause the execution of a VI at any subVI, node, or wire, use the Breakpoint tool to click the object and run the VI.
  • To temporarily stop the execution of a VI or to insert a probe, click the Pause button on the toolbar.
    • I don't think these qualify as advanced tips and tricks. This is the regular function of debugging tools
  • VISA Open is optional. If you wire a VISA name control directly to any VISA function, a VISA session opens automatically when you first use the function.
    • This is bad practice
  • You can use an annotation instead of a cursor to highlight data points on the plot area.
  • To increase the point size of data symbols on graphs and charts, increase the line width of the plot.
    • These require more details to be useful. What is the benefit and how exactly are these done (setps)?
  • To resize a selected object to a specific size in pixels, use the Positioning tool to move the cursor over a resizing handle and click and hold the mouse button. A tip strip that lists the current size of the object in pixels appears outside the bottom border of the front panel or block diagram window. As you resize the object, use the tip strip to change the size to a specific size in pixels.
    • If I need to resize an object to a specific size, the sizing tools are a much better option.
  • If you place dialog labels over wires and then use the VI Analyser to inspect your VI's, the Block Diagram, Style test "Wires Under Objects" will report a fail for this situation by default. You can avoid this fail and still ruin the test by unchecking the <Include Decorations> in the VI Analyser Test Configuration page.
    • I think this is too specific
  • To add external VIs and LLBs to the LabVIEW Tools menu, place them in the labview\project directory and restart LabVIEW.
  • To add a menu mnemonic insert an '_' (underscore) before the letter you want to be triggered.
    • This deserves an article on its own (if it doesn't exist yet)
  • Close without saving, if you want to close a VI without a prompt to save it use the following code snippet:
Closing a VI without a save prompt
    • Again, too specific in my opinion
  • To anchor a match at the beginning and end of a string, use a caret (^) as the first character in a pattern and a dollar sign ($) as the last character of a pattern. For example, ^dog$ matches dog in dog but not dog catcher or the dog. Note that anchoring the match at the beginning and end of the string requires the whole string to match.
    • This is standard regex behavior. I think it makes much more sense to link to a good guide on general regex syntax
  • There is a way to create so called "pull-right" properties for XControls. Change the localized long name of the property to include the nesting. For Example: If you have a property called My New Nested Property 1 and you want the menu to appear like Mike->My New Nested Property 1, set the Localized Long Name to Mike:My New Nested Property 1. Colon is used as the separator.
Configuring an XControl sub-property menu
What an XControl sub-property menu looks like
  • You can create line separators by replacing the Localized Long Name completely with a hyphen "-". Of course, this means you lose access to the property since now it's not selectable. You would probably create dummy properties to support this.
    • XControls are waay to complex for a general purpose guide like this.

--Logmanoriginal (talk) 18:45, 13 May 2020 (UTC)

@Logmanoriginal Would it be good to maintain a Tips and Tricks page? My thought is most of this page should be moved to a page for that subject. Some things don't have pages yet but I'm working on it. In some of the pages I've created recently I have included a "Best Practices" section. Some of these could be placed in a section like that for the page or there could be a "Tips and Tricks" section on the page. --Q (talk) 18:54, 13 May 2020 (UTC)
@Q: Absolutely! You take the words right out of my mouth :) I decided to work through this page first, in order to make it more understandable (hopefully). Next up is moving everything on their respective pages. --Logmanoriginal (talk) 19:08, 13 May 2020 (UTC)
Okay, I moved everything that seems useful to other pages. I'll delete this page after removing all interwiki links. --Logmanoriginal (talk) 12:58, 15 May 2020 (UTC)