Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Tutorial: Creating and Opening a VI Using VI Scripting

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Complete the following steps to create a VI that uses VI Scripting to create and open a target VI.

Note Note  
  • This topic assumes familiarity with the VI Scripting introduction.
  • You must enable VI Scripting to display the VI Scripting VI and functions and use the associated properties and methods.
  1. Select File»New VI to create a new VI.
  2. Add the New VI function to the block diagram.

  3. Add a Property Node to the right of the New VI function.

  4. Wire the vi refnum output of the New VI function to the reference input of the Property Node.
  5. Resize the Property Node so it contains four terminals.
  6. Add the following properties to the Property Node.
    • Front Panel:Open—Click the first terminal of the Property Node and select Front Panel Window»Open from the shortcut menu.
    • Front Panel Window: Window Bounds—Click the second terminal of the Property Node and select Front Panel Window»Window Bounds from the shortcut menu.
    • Block Diagram Window: Open—Click the third terminal of the Property Node and select Block Diagram Window»Open from the shortcut menu.
    • Block Diagram Window: Window Bounds—Click the fourth terminal of the Property Node and select Block Diagram Window»Window Bounds from the shortcut menu.
    Because the Block Diagram Window properties belong to the VI Scripting class, the Property Node turns blue when you add the Block Diagram Window properties.
  7. Right-click the Property Node and select Change All To Write from the shortcut menu.
  8. Create constants for each property and configure the constants to match the block diagram in step 10.
  9. Add the Close Reference function to the right of the Property Node.

  10. Complete all wiring to match the following block diagram.

  11. Save the VI as ScriptingTutorial.vi.
  12. Run the VI.

LabVIEW creates and opens untitled front panel and block diagram windows.

To continue this tutorial, continue to the Tutorial: Adding an Object to a VI Using VI Scripting topic.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit