RioRide3b Posted February 24, 2005 Report Share Posted February 24, 2005 Hello, I am new to LabView and had a few questions. I didn't know which subtopic to post this in, so Moderators feel free to move this where it should be! I have written a power flow program in C++ that reads in data from an input file, buts the data into objects accordingly, runs some Newton Raphson techniques to calculate load flow of a power system, and writes the results to a file. I would like to integrate this program with LabView. I was envisioning some sort of SCADA type system that could read data from the objects in my C++ code and display these results on the screen. I don't know if I should do this by creating a DLL and use the Call Library Function Node or if I should use Code Interface Nodes. I'm not exactly sure what the difference between the two techniques are, and I'm also not sure if I can use the LabWindows/CVI to create DLL files from my C++ code. I think it will be possible for me to get my hands on Microsoft Visual C++ if need be. Could I use a Borland C++ compiler? What about a gcc compiler in Linux? I have written the C++ code in Linux, but I am running LabView on a Windows 2000 machine. Any help would be greatly appreciated! Thanks. Quote Link to comment
FLX Posted February 24, 2005 Report Share Posted February 24, 2005 Hi, I recommend you call your code as shared library. If you port your code to windows, in my opinion the easiest way to call your code it the Call Library Function. You create a dll and call it directly from labview. The CIN Code Interface Node is possible too, but with an dll you have a well known interface type. With a lot of examples and application nodes on your side. Check first your function call you are need, LV only supports labview data types. If You are stay at Linux, you create a shared library ( .so or something like that :question: ). LV for Linux has the node Call Library Function, too. I hope this helps. Fine Alex Quote Link to comment
RioRide3b Posted February 24, 2005 Author Report Share Posted February 24, 2005 Thanks FLX for the reply. I was under the impression that using the Call Library Function would be the way to go, but wasn't sure. Assuming all my function calls are supported by LabView, can I create the DLL file using LabWindows/CVI or do I need a C++ compiler such as Microsoft Visual C++ or Borland? I wish I could stay on a Linux box, but unfortunately the NI software available to me is for Windows. Quote Link to comment
AnalogKid2DigitalMan Posted February 24, 2005 Report Share Posted February 24, 2005 You may want to refer to the pdf document "Using external Code in LabView" listed under Help/Search The LabView Bookshelf page. It contains all the skinny on conventions and compilers supported. Quote Link to comment
RioRide3b Posted February 24, 2005 Author Report Share Posted February 24, 2005 I have referred to that specific pdf document, yet it still left me a little confused. Can I use the Code Interface Node approach if I have C++ code that has not been compiled? Quote Link to comment
FLX Posted February 25, 2005 Report Share Posted February 25, 2005 No you have to compile the C++ code with a compiler. LabVIEW does not compile it for you. good luck lx Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.