LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need Developer studio (C++ programming language) in my computer when I call a dll through my labview?

Solved!
Go to solution

 

 

Thanks in advance...

0 Kudos
Message 1 of 48
(2,135 Views)
Solution
Accepted by topic author yemin

 

In other words, the computer I am using for labview does not have an installed C++ program.. What I am thinking is to convert my C++ code to dll in another computer and use this dll in the computer which has labview.. So is it possible? or The computer with installed labview has to have C++ program....

 

Regards...

0 Kudos
Message 2 of 48
(2,129 Views)

No, you do not need the C++ development environment on the PC that has LabVIEW. The DLL is already compiled.

0 Kudos
Message 3 of 48
(2,121 Views)

 


@yemin wrote:

 

In other words, the computer I am using for labview does not have an installed C++ program.. What I am thinking is to convert my C++ code to dll in another computer and use this dll in the computer which has labview.. So is it possible? or The computer with installed labview has to have C++ program....

 

Regards...


 

No Viusual C++ is not needed for the computer where you want to call the DLL, but the according Visual C runtime library distribution might be.

 

You might have to do modifications to your C++ code however. The Call Library Node allows to call exported functions, no C++ object interfaces. And sometimes C/C++ parameters are to much of a pain in the a** to be called directly from the Call Library Node, so that it is beneficial to create different fucntions that proivide more LabVIEW friendly paramter types.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 4 of 48
(2,106 Views)

 

 

    Thank you Rolf and  smercurio_fc 

 

    My C++ code has many inputs and I am going to get different results ( pressure-temp-friction etc). I am looking at call library function and I couldnt add more than one "return type" . Do I need to name parameters like return type 1, 2, 3 etc... Do you have an idea, how can i get more than one return result? 

   

    Also, when i run my c++ code, I can get all results in a notepad file.... In labview when I run the dll, how can i create that kind of file in the computer to store my run's result?

 

   Thank you again, I am very beginner at Labview.....

   Regards,

   

0 Kudos
Message 5 of 48
(2,083 Views)

You can use a "Write to Text File" to write to a text file.  It's easy to implement and can be found in the File IO Palette.

0 Kudos
Message 6 of 48
(2,079 Views)

 


@yemin wrote:

 

 

    Thank you Rolf and  smercurio_fc 

 

    My C++ code has many inputs and I am going to get different results ( pressure-temp-friction etc). I am looking at call library function and I couldnt add more than one "return type" . Do I need to name parameters like return type 1, 2, 3 etc... Do you have an idea, how can i get more than one return result? 


 

A C function can have only one return value. This is a C limitation, not a LabVIEW limitation. What's sometimes done in this case is to have these additional values "returned" as function arguments. You pass in a pointer to a value of the appropriate data type, and the function will write the new value to that memory location. If you don't know what that means, then I'd suggest spending some time with C tutorials.

 

 


    Also, when i run my c++ code, I can get all results in a notepad file.... In labview when I run the dll, how can i create that kind of file in the computer to store my run's result?


 

As noted, you can use Write to Text File. Or, you can use Write Spreadsheet File to create a delimited text file that can be easily imported into a spreadsheet application such as Excel. Or, you can use the Write to Measurement File VI if you want extra formatting at the beginning.

 

 


   Thank you again, I am very beginner at Labview.....

 


We were all beginners at one point. To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

 

0 Kudos
Message 7 of 48
(2,068 Views)

Hello,

 

1)       A code was written in C++ builder and converted to the dll.   ( doubles have in code)

2)      I added 38 values to the call library function as input parameter

3)      I left return type “void”  (because I want a file for all results, like in array)

4)      I did not click on “specify path on diagram”

 

When I did those,  Labview gave an error like this :

 

Call library function node ‘dll_version.dll:_CPPdebugHook’: Library not found or failed to load


Under this block diagram error in details, it says:

 

The library specified for this node cannot be found or cannot be loaded. Right-click the Call Library Function node and select Configure, then choose the correct library name or path.


If I click in “specify path on diagram”  ( number 4 above ) then it doesn’t give any error if I add a “control” to path in . I can click run button, it doesn’t show error but on the other hand it does not give any result…

 

I really want some help above situation…What can I do ??

 

Best Regards

0 Kudos
Message 8 of 48
(2,036 Views)

Can you explain that again but in a different way? I don't really understand what you want to do and know.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 9 of 48
(2,032 Views)

duplicate post

Rolf Kalbermatter
Averna BV
0 Kudos
Message 10 of 48
(2,031 Views)