From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Scripting a Call Library Function Node Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example shows how to script the Call Function Library Node which calls to the Windows OS.

 

Description

One function that takes a good amount of effort to script is the call library function node.  In this example, I show all the parts necessary to script a Call Library Function node that makes a call to the Windows OS and returns the name of the computer.

 

Requirements:

  • LabVIEW 2012( (or compatible)

 

Steps to Implement or Execute Code

  1. Select Tools»Options to display the Options Dialog box
  2. Select VI Server from the Category list
  3. Place a checkmark in the Show VI Scripting Functions, properties, and methods checkbox
  4. Click the OK button to apply the changes and close the Options dialog box
  5. Run the VI
  6. A new VI is created.  This VI contains the Call Library Function Node that returns the computer name
  7. Run the VI
  8. Notice the output of the VI is correct.

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.