04-19-2011 05:00 PM
04-19-2011 05:03 PM
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...
04-19-2011 05:17 PM
No, you do not need the C++ development environment on the PC that has LabVIEW. The DLL is already compiled.
04-20-2011 03:41 AM
@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.
04-20-2011 11:50 AM
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,
04-20-2011 12:00 PM
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.
04-20-2011 01:03 PM
@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.
05-03-2011 10:35 AM
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
05-03-2011 10:55 AM
Can you explain that again but in a different way? I don't really understand what you want to do and know.
05-03-2011 10:55 AM - edited 05-03-2011 10:55 AM
duplicate post