LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

explicitly calling class constructor

I'm calling a .net dll from labview and would like to explicity call out the path for the contructor in the vi to avoid the risk of the code linking to the wrong contructor. Is there a way to make a terminal for the constructor visible so I can hardcode a relative path of the dll? I know that the traditional dll block has the "specify path of diagram option". Can this be done with the .net block? If not, how can I prevent it from using the wrong dll? 
0 Kudos
Message 1 of 3
(3,002 Views)

Good Afternoon Steve,

 

There is no way to wire a path for a Constructor Node.  As you have discovered, the Select .NET Constructor window will pop up when you place a Constructor Node on the Block Diagram.  This creates the reference that LabVIEW can use with Property and Invoke Nodes.


Once this value is set, it will never link to the wrong constructor; it is hard coded.  It should return an error if the Constructor for which it is looking is unavailable.

 

For everyone's reference:  How Do I Call a Dynamic Link Library (DLL) from LabVIEW?

0 Kudos
Message 2 of 3
(2,982 Views)
In CVI there a function called CDotNetRegisterAssemblyPath which registers a file path of an assembly. How come Labview cannot do this. Also, if I have multiple copies of a .net dll on the machine, how can I assure that the correct one is being used?
Message 3 of 3
(2,970 Views)