05-08-2019 07:15 AM
Hi,
I'm a beginner of LabVIEW.
I straggled with calling .NET module from LabVIEW, but I couldn't. I just wired create instance->method invoke->complete and the code became executable, but an error occurred when the wired program was executed. (The module returned "E_FAIL")
I would like to call COM interfaces inside the module, but is it possible to call them? I also tried to call COM interfaces directly inside the module by using "Library Function Calling Node", but I couldn't find the interfaces in the list of methods.
I look forward to your reply.
Thanks,
Hideki
05-09-2019 04:08 AM
Hello yamahide!
The Library Function Call Node is used to call "normal" DLL files.
The more modern, object-oriented .NET assemblies (with the same file extension though), are used with the way I think you described. Use the .NET Constructor Node, then use e.g. Invoke Nodes.
See e.g. DLL Functions Unavailable to Be Selected on Call Library Function or Example Program: Calling .NET Assemblies From LabVIEW for more information.
However, it's impossible to tell what the exact issue with your code it. Can you post your LabVIEW VI here? If possible, please save it in an older file format (LV 2014 is good) so more people can open it. When you have the VI open, go to menu File » Save for Previous Version.
05-09-2019 04:42 AM
Thanks for your reply!
I also really appreciated for you information that the node can only call 'normal' dll.
I also had already tried if I could call the interfaces by using method invoke of .NET control.
Unfortunately, I only had LabVIEW 2018 and my evaluation licence has been expired.
I attach the VI file of new version, but I'm not sure if it is useful.
Many thanks,
yamahide
05-09-2019 05:05 AM - edited 05-09-2019 05:06 AM
Hello Hideki,
Thank you very much for your quick reply and the attached VI. I believe it was useful, as I can confirm you set up up the same way I would do. So I'd assume the issue is not with your LabVIEW programming, but:
Do you have a working piece of code in e.g. C# that successfully calls this DLL? That would e a great start to know that it generally works, and also a good code example on how it should be used. Maybe you can work from there? If that does not exist, documentation or testing (trial&error) could help.
05-09-2019 10:01 AM
Thanks for your reply.
I created the module, so I know everything about the module actually.
Sorry, I can't provide the C# module which can call the interfaces properly.
However, your information was very useful and I really appreciated for it.
Many Thanks,
Hideki