07-02-2016 01:45 AM
I have .net assembly having >net class with public constructor.
I am trying to select constructor of that assembly in LabVIEW 2015.
Assembly load when I select constrctor node but it is not showing public constructor so I am not proceeding with my application development.
I had put this assembly in GAC also but still public constrctor is not displayed.
07-02-2016 03:05 AM
I have attached .NET dll
07-02-2016 01:32 PM
How about attaching the LabVIEW VI that demonstrates the problem?
Bob Schor
07-03-2016 02:19 PM
I notice that the assembly is specified for x64 only. Are you trying to load this in LabVIEW 2015 32-bit?
07-03-2016 06:35 PM
Besides to what tyk007 suggested: if the constructor uses generics, then LabVIEW can't invoke it since it does not support generics.
07-04-2016 12:03 AM
No. I am trying to access this dll in 64 bit LabVIEW 2015.
I am sending snap of my problem.
Are you able to see constrctor at your machine.
07-04-2016 01:13 AM
The documentation to the DLL would have been more useful to show than attaching the DLL.
According to the manual they call this the constructor for the main device, but their computer programming terminology is a bit amateuristic. It's not an object interface with a constructor but rather a static interface whose only method apparently serves as instantiation for a singleton object.
Try to create a .Net refnum on the frontpanel and browse to your DLL and then select your ConexCC class directly. Wire on the diagram a method node to this refnum and you should most likely see one single method ConexCC() in there. You don't instantiate static objects. You can also see that in the Newport documentation. A normal object instantiation would use the syntax
CC = new ConexCC();
But their example doesn't use the new keyword at all, so it's a static object invocation.
07-04-2016 02:12 AM
DLL is having public methods and not static methods.
So I am usiong this DLL in my .net application as ConexCC obj = new ConexCC() and it is runing fine.
I Have done your suggetion my home computer and it is showing all methods.
Please see attached snapshot.
I will check on my office computer where constrctors are not displayed and let you know.
07-04-2016 04:27 AM
The manual clearly gives as example:
# create a device instance and open communication with the instrument CC = ConexCC() ret = CC.OpenInstrument(instrumentKey) print 'OpenInstrument => ', ret # Get positive software limit result, response, errString = CC.SR_Get(1) if result == 0 : print 'positive software limit=>', response else: print 'Error=>',errString
There is no "new" keyword with the retrieval of the ConexCC() object. If there was you would need to execute the LabVIEW constructor node but since there isn't you the constructor node should not only not be needed but really can't be executed. Maybe that C# in newer versions has some smartness built in to ignore the new keyword for static objects, or maybe that the Newport example code in the manual is wrong!
07-04-2016 07:00 AM
This is Python example.
I am able to see constructor at my home computer.
Please see attached snapshot.
But I am not able to see constructor at office computer.