LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CIN + DLL + C++ = ????

I have a bunch of C++ codes that I would like to incorporate into a LabView program.  I've been trying to follow the directions:

http://www.ni.com/pdf/manuals/370109a.pdf

"Using External Code in LabView"

I'm not a true programmer (so I pretty much understand ~50% of the directions), but I write LabView codes all the time.  I've gathered that it is better to create DLLs rather than CINs - but I've been trying both with no luck what-so-ever.  My problem is definitely with compiling the codes.  I downloaded Visual C++ 2005 Express Edition.  Is there a tutorial I've missed that would describe how to convert a C++ code to a DLL using Visual C++ 2005 Express Edition (or do I have to fork over the cash and get Visual C++?)?  As a non-programmer (total newbie), I have no idea what is going on in that program.  I've tried creating a new project, but the DLL option is greyed out.

I've also tried following the example (for making a CIN):

http://zone.ni.com/devzone/cda/tut/p/id/4161

I'm good until I have to compile the code to a .lsb file.  Then I don't understand the directions at all.  Any suggestions will be greatly appreciated,

Thanks!
0 Kudos
Message 1 of 7
(3,636 Views)
Hi,

What I've learned from this forum is that use DLLs instead of CIN, because CIN might not
be supported in the future releases of LabView. This info is not official, and it might not even
be true, it's a rumor that I heard.

You can create DLLs with the express edition of VC++. What are the compile errors that you
get? Can you add some piece of code that shows how you are creating the DLL?

Here's a link to an article that you should also read

Building a DLL with Visual C++

0 Kudos
Message 2 of 7
(3,614 Views)


kaêm wrote:
Hi,

What I've learned from this forum is that use DLLs instead of CIN, because CIN might not
be supported in the future releases of LabView. This info is not official, and it might not even
be true, it's a rumor that I heard.


Yes it's a rumor and NI never officially made a statement to this matter yet. However if LabVIEW for 64bit is ever coming out (IF as NI never really said anything about when if ever that will be either) it is quite likely that they will not port the whole CIN tool chain to 64 bit. Same for other forthcoming LabVIEW platforms that might eventually surface.
 
It's very likely that existing CINs will continue to run for several versions in the 32 bit variants of LabVIEW but the support for creating CINs may at some time entirely vanish.
Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 7
(3,593 Views)
I've tried to follow the example in the 'Building a DLL with Visual C++' link:

http://zone.ni.com/devzone/cda/tut/p/id/3056

But, it seems Visual C++ 2005 Express Edition (the free one that I am trying to use) is different from the above example.  When I go File-New-Project, a menu comes up (different from the one in the example) where I choose Win32.  Then there is an Application Wizard, and although it has a DLL option - that button is greyed out.  I've tried other options in General and CLR, but I have not been able start a new project as a DLL.  I'm guessing that the above link/example is for a fancier version of Visual C++ that you have to pay for, but I'll keep searching.
0 Kudos
Message 4 of 7
(3,584 Views)
Another link you could look at is:

http://www.codeproject.com/csharp/usecdlllibincs.asp

I've used this method with 2005 & 2008 express edition with success. Try is with something simple like adding 2 numbers together first to get a handle on dll linking and creating.

It is just too bad that we have to go to third party software in order to create a dll. Wouldn't it be nice if LabView has a simple C compiler built in just so you could build dlls or better yet enhance the formula node to be able to compile C function calls. That way we could make seperate little vi's with just the formula node in them and get rid of dlls all together. Maybe it is just that National Instruments doesn't understand how to compile C code. Wait that can't be, there is this thing called LabWindows/CVI. Smiley Wink
0 Kudos
Message 5 of 7
(3,578 Views)


Skydyvr wrote:
Another link you could look at is:

http://www.codeproject.com/csharp/usecdlllibincs.asp

I've used this method with 2005 & 2008 express edition with success. Try is with something simple like adding 2 numbers together first to get a handle on dll linking and creating.

It is just too bad that we have to go to third party software in order to create a dll. Wouldn't it be nice if LabView has a simple C compiler built in just so you could build dlls or better yet enhance the formula node to be able to compile C function calls. That way we could make seperate little vi's with just the formula node in them and get rid of dlls all together. Maybe it is just that National Instruments doesn't understand how to compile C code. Wait that can't be, there is this thing called LabWindows/CVI. Smiley Wink


We aren't asking for much, aren't we? Just get the Developer Edition of LabVIEW and LabWindows CVI is included among many other things. There comes your C compiler!
 
Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 7
(3,568 Views)
I finally figured out how to to make DLLs using Visual C++ 2005 Express Edition.  Basically, you have to download the Microsoft Platform SDK update, and do a bunch of tedious little things.  The directions are here:

http://msdn2.microsoft.com/en-us/express/aa700755.aspx

After doing these things, I was able to follow the directions on the NI page listed above (Building a DLL with Visual C++).
0 Kudos
Message 7 of 7
(3,552 Views)