Passing Data to Another VI Using an Invoke Node with VI Server

Updated Mar 13, 2023

Reported In

Software

  • LabVIEW Full
  • LabVIEW Professional

Issue Details

I want to open and run my VI using VI Server. How can I pass data into my VI, or extract it using VI Server?

Solution

  1. You can use a Call By Reference Node to dynamically call your VI. The Call By Reference Node method allows you to pass values to controls and return values from indicators. This method is the preferred method for passing data into the VI using VI Server. See Calling a VI by Reference and Differences Between Calling a VI with an Invoke Node and Calling a VI with a Call by Reference Node  for more information
  2. You can also use the Ctrl Val.Set and Ctrl Val.Get methods to accomplish this task. To use this method you must first open a reference to the VI using the Open VI Reference function, and then pass the data using a separate Invoke Node before you call the Run VI Invoke Node. The process will require one Invoke Node for each Control you pass data to. You must know the name of the control and its data type. You can use the Ctrl Val.Set method for the Invoke Node to pass the data. You must make sure the names and data types match, or you will receive an error stating that an input parameter is invalid. If you are going to extract information from the VI, you will need a separate Invoke Node for each indicator you want to retrieve information from. Use the Ctrl Val.Get method to retrieve information.
Open VI Server.png
Figure 1: Using Get/Set Control Values
 

Additional Information

If trying to pass data between a VI and an executable, see Passing Data Between LabVIEW Executable Reference VI and a VI.
When using the Open VI Reference method, it is important to close the reference to avoid unexpected behaviors.