Jump to content

Using already written C++ code in LabView


Recommended Posts

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.

Link to comment

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

Link to comment

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. :(

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.