04-07-2010 08:51 AM
I have known how to call a function in dll with Library function node。
But the dll file I am going to use contains some variables which I need. But the LIbrary function would not work!
Would Code interface node work? I have only a limited knowledge of C++. So I am wondering it.
Thx for any suggestion ![]()
Solved! Go to Solution.
04-07-2010 09:06 AM
Hi youminbuluo,
can you give some more informtation please? Is it your own dll? Can you change things inside of it? What have you already done?
Mike
04-07-2010 10:25 AM
A CIN is a different beast. CINs are obsolete technology, so you should not use them unless you absolutely have to.
You cannot "access" variables inside of a DLL. You can only call functions. Furthermore, LabVIEW only handles C-type DLLs. If you are programming in C++ then you need to make sure you're correctly exporting the functions. Have you looked over the LabVIEW Help? You should also read over this article: Writing Win32 Dynamic Link Libraries (DLLs) and Calling Them from LabVIEW.
04-07-2010 08:33 PM
MikeS81. Yes, I have have give more details on this. But I was so sleepy yesterday.
I don't have the source code of the dll file. It is provided by hardware manufacture. I only have .h, .lib and .dll file. It is thought to be enough,right?
I have post the h file here.
What I have done is wrap those functions like "extern CIDLL_API BOOL WINAPI CIUsbLinked(void) " in labview. I can do that through Tool->Import->Shared Library(.dll). But to those variables such as "extern CIDLL_API BOOL UsbInited", I haven't figure out how to use them in my labview program. Those variables are important because they show the real time state of the hardware.
04-07-2010 08:53 PM
Yes, I know that. I have read the first 14 chapters of LabView for everyone.![]()
The author has the same opinion with u. But I really have to use the dll which originally developed and used in Visusal C++
And for anyone who has the experience with such situation, I have attached the whole dll file and its demo, which is used in Visual C++.
04-07-2010 10:50 PM
04-08-2010 08:44 AM
So much thanks!
It is exactly what I need to do and I have succeeded