LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CIN and Labview

Hello!
I´m new using CINs. When i try to compile the examples as,for instance,avg1.vi i´ve got and i don´t find the file extcode.h.
Can you help me?
Thanks in advance,
Esther
0 Kudos
Message 1 of 10
(5,155 Views)
Esther;

The file "extcode.h" is located in the "cintools" folder in your LabVIEW directory, unless the have the basic LabVIEW development environment. If that's the case, then you won't have it.

Regards;
Enrique
www.vartortech.com
Message 2 of 10
(5,129 Views)
Enrique, thanks for your answer.
I have NI Dev Suite Standard Edition. Does it mean i need another extra tool for using CNIs and Labview?. I´m interested in using C Code with Labview.
Thanks in advance
Esther
0 Kudos
Message 3 of 10
(5,126 Views)
I believe that it's only the professional version of LabVIEW (not base or the full version that comes with Standard Dev Suite) that has the CIN and DLL tools. You would need to upgrade your version. Once you do, I would recomend using the Call Library Node function to call DLLs that you write in C instead of the Code Interface Node. A DLL is, imho, easier to write and debug than a CIN.
0 Kudos
Message 4 of 10
(5,117 Views)
I second Dennis. There is rarely a good reason to use CINs anymore. You will have much better luck with DLLs and the Call Library Node. Take a look at the Calling External Code in LabVIEW manual for help. There are also some great examples, especially the CallDLL VI
0 Kudos
Message 5 of 10
(5,099 Views)

Esther;

Check this page to verify if you should have the tools to work with external code. I am also attaching a simple VI to check if you have the file extcode.h in your computer (VI created with LabVIEW 6).

About using a CIN node: I haven't verify, but it seems that with CIN you can create cross-platforms VIs. If that's true, then CIN possess a big advantage over DLL files which are Windows only. Check Volume 10, Number 1 of LTR. I'll really appreciate if somebody can shed light on this.

Regards;
Enrique

www.vartortech.com
Message 6 of 10
(5,092 Views)
Hello,
once i´ve solved the problem with "extcode.h" i don´t know how to use this samples in Labview. I´m using lstrcat.c and when i try to compile the file i have Undefined symbol '_main' referenced in "c:\archivos de programa\national instruments\cvi70\bin\cvistart.lib".

I open the file and only have:
/* CIN source file */

#include "extcode.h"

MgErr CINRun(LStrHandle A, LStrHandle B);

MgErr CINRun(LStrHandle A, LStrHandle B)
{

/* Insert code here */

return noErr;
}


Is there any manual or samples i can use ?
Thanks in advance
Esther
0 Kudos
Message 7 of 10
(5,073 Views)

Yes! There are a lot of examples! Just do a search using the keyword CIN. You will find pleanty of information such as External Code for LabVIEW - CIN / DLL - Starting Point, How to build a CIN code resource (.lsb file) and How To Create a CIN in Microsoft Visual C++.NET. The document Using External Code in LabVIEW is the official guide, and should be included with LabVIEW.

Regards;
Enrique

www.vartortech.com
Message 8 of 10
(5,062 Views)
Enrique wrote:

>I haven't verify, but it seems that with CIN you can create cross-platforms VIs.
>If that's true, then CIN possess a big advantage over DLL files which
are Windows
>only. I'll really appreciate if somebody can shed light on this.

Unfortunately the VI is not cross platform. The CIN source code if
written in the correct way, can be recompiled on all LabVIEW platforms
but the VI loaded with a CIN for a particular platform will be not
executable on other platforms without reloading the CIN resource for
that platform in the development system.

For DLLs/shared libraries it is possible to create VIs which will work
on all LabVIEW platforms without manual interaction. The idea is to make
sure that the DLL/shared library exports all functions as cdecl. Also in
the Call Library Node you enter the library name as "<name>.*".

First you create the shared library/DLL according to the prefered
platform method and preferable from the same source code (this needs
some care to create multiplatform compilable source code). Now put the
resulting shared library in the same directory as the VI files and
everything should work. For an example how this does work you can
checkout the lvzip library from OpenG which provides shared libraries
for Windows, Linux and MacOS, but other LabVIEW platforms would be
possible too if there are people who have that system and would be able
to create the shared library there.

Rolf Kalbermatter


Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 9 of 10
(4,985 Views)
Dennis Knutson wrote:

>I believe that it's only the professional version of LabVIEW (not base
>or the full version that comes with Standard Dev Suite) that has the CIN
>and DLL tools. You would need to upgrade your version.

In fact the Full development system is enough for the Advanced Analysis
Library and CIN tools.

>Once you do, I would recomend using the Call Library Node function to
>call DLLs that you write in C instead of the Code Interface Node. A DLL
>is, imho, easier to write and debug than a CIN.

I second this recommendation. There are almost no reasons nowadays to
use a CIN. DLLs are in general simpler to develop and test and have the
additional benefit that you could use them from other environments as
well. Debugging is in both cases about the same really if you want to do
it calling the DLL from LabVIEW but you can of course debug DLLs also by
calling them from simple C, VB, Delphi, or whatever applications.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 10 of 10
(4,985 Views)