Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Send Control Values to Dynamically Called VI

Overview

This example demonstrates how to set and get values from controls and indicators of a dynamically called VI.

 

Description

LabVIEW can link to subVIs by two different methods:

  • Static
  • Dynamic

Statically linked subVIs are the normal subVIs that are dropped on the block diagram of the main VI. A statically linked subVI is loaded into memory at the same time the main VI is loaded.

With dynamic linking, subVIs are not loaded until specifically instructed by the code of the main VI. This enables the programmer to create applications which can exchange parts of the application during run-time.

This example shows one way to exchange data between the caller and the callee. To do so, the property node Set Control Value and Get Control Value is used.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • If running in a Real-Time context, you will need the LabVIEW Real-Time Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download and open the attached ZIP-file
  2. Open and run the [Main] ...VI

 

Additional Information or References

Transfer Values To And From A Dynamically Called VI - Front Panel.png

 

Transfer Values To And From A Dynamically Called VI - Block Diagram.png

 

Note: This example shows one possible way to transfer data to and from a dynamically called VI.
Depending on your application, there are many other ways to accomplish the same functionality with less effort.
Take a look into this documents:

Differences Between Calling a VI with an Invoke Node and Calling a VI with a Call by Reference Node
http://digital.ni.com/public.nsf/allkb/4838398F3B2798A186256B82007B4ED0

Asynchronously Calling a VI without Collecting the Results - LabVIEW 2016 Help - National Instruments
https://zone.ni.com/reference/en-XX/help/371361N-01/lvhowto/acbr_call_and_forget/

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner