LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I load the MCP2210 dll in Labview? If I try to do so by means of a constructor node and I point to the library I get an error code!:

Then I accept the challenge. If I get it going in labview I'll post here. Thanks anyway, Michael.
0 Kudos
Message 11 of 17
(1,599 Views)

is it possible to attach to a lw vi a c++ code that uses this dll? The
dll works well in c++ but it is not as accessible as it would be whei
integrated in a vi - actually, it is all about conrolling the chip by
mans of lw!

0 Kudos
Message 12 of 17
(1,585 Views)

Hi mpop,

 

When you say "lw", are you referring to LabVIEW or LabWindows™/CVI™? And what do you mean when you say that "it is not as accessible as it would be whei integrated in a vi - actually, it is all about conrolling the chip by
mans of lw!"? Are you asking how to call a C++ dll in LabVIEW? If you are wondering how to call C++ code from LabVIEW, here is a link that should help to answer your question.

 

Andy F.
Applications Engineering
National Instruments
0 Kudos
Message 13 of 17
(1,562 Views)
I think the dll cannot be called because it uses c++ classes and non native data types. Looking around, it seems I need to get someone to build a dll wrapper to expose the functions in a way labview can access them. I had thought a dll was a dll, but apparently not. I wish labview had a clever trick to get this going easily
0 Kudos
Message 14 of 17
(1,553 Views)

Yes, LW means labview. The message was written on mobile phone!

 

I'm thinking that I'd start writing a c++ code that uses the dll but I would't use it much since it's not compatible with LW environment. If I could call it from LW, then it would start to make sense writing this code. It's like this code is a bufer between LW and the DLL since the DLL  is not directly usable from LW?

 

Kindly advise! Thank you!

0 Kudos
Message 15 of 17
(1,533 Views)

Hey mpop,

 

To expand on Michael78's post earlier, LabVIEW's Import Shared Library Wizard is normally used to create or update LabVIEW wrapper VIs for functions in a .dll file (or .framework for OS X, or .so file for Linux).  This wizard uses the Call Library Function Node, which does not support the C++ this pointer or calling methods in C++.  That being said, as Michael78 mentioned, you will need to create a custom wrapper with for each function in order to use this C++ DLL in LabVIEW.  You CAN use C++ code but it must be wrapped within C functions to be used in LabVIEW.  That being said, a C++ DLL with only primitive data types should be able to be used without having to manually create wrappers.

 

Hopefully, this helps!

Eric
Applications Engineer
National Instruments
0 Kudos
Message 16 of 17
(1,520 Views)

@mpop wrote:

Yes, LW means labview. The message was written on mobile phone!

 

I'm thinking that I'd start writing a c++ code that uses the dll but I would't use it much since it's not compatible with LW environment. If I could call it from LW, then it would start to make sense writing this code. It's like this code is a bufer between LW and the DLL since the DLL  is not directly usable from LW?

 

Kindly advise! Thank you!


It's not so much the fact that you use a C++ compiler or not but what type of functions you export. Basically anything C++ specifc like classes, class methods and such are not usable from the Call Library Node, The reasons are manyfold and some pretty technical but the most important one is that there doesn't exist a binary application programming interface standard for C++. Each C++ compiler does it in its own way partly because it's fun to be different, partly because certain C++ compiler builders patented techniques like structured exception handling (SEH) so that other C++ compiler builders couldn't use the same methods. As such the creation of a Call Library Node equivalent for C++ code is a practical impossibility.

 

If you have the C++ code for a library you can easily expand it to add static function exports to the llibrary that then call the actual object methods, otherwise you need to write a wrapper DLL in C++ that exports standard C functions to wrap the object methods. Since you call C++ code you need to use a C++ compiler but the DLL you create needs to export standard C functions for the Call Library Node to call into.

Rolf Kalbermatter
My Blog
0 Kudos
Message 17 of 17
(1,508 Views)