Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 68984

How to programmatically add UDVs to project?

$
0
0

Hi all,

 

I have successfully used something like this to programatically add shared variables to an LVLIB (the code assumes that the library associated with the Container Reference contains at least one variable):

Programatic Variable Add.png

 

An example output would be:

  • Container Name: "MyLibrary.lvlib"
  • Variable Name: "Variable1"
  • Variable Path: <blank>
  • Variable Type String: "Variable"

(I notice that there is no way to specify the data type of the variable, and LabVIEW creates a DBL variable in the LVLIB by default.)

 

 

However, if Container Reference is associated with a "User-Defined Variables" container, then I get Error 1 at the Invoke Node ("LabVIEW: An input parameter is invalid"). A example output is:

  • Container Name: "User-Defined Variables"
  • Variable Name: "Variable1"
  • Variable Path: <blank>
  • Variable Type String: "Variable"

 

Questions:

  1. Does the error occur because LabVIEW is trying to create a DBL variable (which is not allowed with UDVs)?
  2. How can I programmatically add UDVs to my project?

 

Thanks in advance!


Viewing all articles
Browse latest Browse all 68984

Trending Articles