LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview and Cygwin

I have searched through a number of previous postings on the subject
of Cygwin and
LabVIEW compatability, but many seem inconclusive.

I am considering porting a lot of Unix/Linux C code to run under
Labview and
foe me, using Cygwin is an attractive option.

So has anyone successfully used Cygwin to compile code to use with
CIN or Call Library Function nodes? Or is MinGW the way to go?

If the answer is no, is there any recommended compiler apart from
MS Visual Studio?

Philip

0 Kudos
Message 1 of 5
(3,966 Views)

I had done that a few years ago..  back in 2002-2003.

I don't recall having had any issues.. 

I used Call Library Function.

RayR

Message 2 of 5
(3,962 Views)
Hi,


I used Dev-C++, which is a IDE around gcc, gnu c compiler (by default, it can be changed). (DEV-C++ is available on Linux and Windows.) It works just fine. I also used masm32, that obviously doesn't compile c, but can create dll's without problems. Point is, any compiler that can create windows dll's will do, although you might have to tell the compiler not to use class info, to avoid name mangling. I've seen delphi, fort and basic dll's that interfaced with LabVIEW without any problems.


CIN's are a lot trickier, and, as far as I'm concerned, obsolete. There is no reason to use them, and a lot of reasons not to use them. Go for the dll's.


Regards,


Wiebe.
Message 3 of 5
(3,961 Views)

Wiebe,

That brings back memories.. 🙂

I don't know about CIN, but I seem to recall that we investigated this and it was a more complicated approach.  But I remember nothing of it..

Message 4 of 5
(3,952 Views)


@PIP wrote:
I have searched through a number of previous postings on the subject
of Cygwin and
LabVIEW compatability, but many seem inconclusive.

I am considering porting a lot of Unix/Linux C code to run under
Labview and
foe me, using Cygwin is an attractive option.

So has anyone successfully used Cygwin to compile code to use with
CIN or Call Library Function nodes? Or is MinGW the way to go?

If the answer is no, is there any recommended compiler apart from
MS Visual Studio?

Philip



For CINs you have to face two issues currently.
1) The first is that it is legacy technology and it will be hard to get technical support at all for it.
2) Second CIN's have some specific requirements to the C compiler and library issues, with the LabVIEW provided libraries only being available in a COFF format for Visual C compilers and the OMF format for the long obsolete Symantec C compiler. Even if your compiler supports COFF or OMF format that does not mean it can use the provided libraries (Borland C did use OMF at some time but different enough to Symantex C that it usually didn't work) and CINs without those libraries are impossible without strong assistence from NI.

DLLs are much better in that respect but I would expect major roadblocks with CYGWIN for more complex source code. It is meant to port entire projects from Unix source code to Windows and not to create Windows DLLs from Unix source code to integrate them into a Windows application. It could work but LabVIEW is a complex enough application that it will likely fail on all sorts of compatibility issues from such a setup.

MingW (Dev C++ might be your choice here as it has a nice development environment built around the MingW tool chain) has a much better chance to work. First it tries to create as much of a Visual C compatible environment as it can and its link libraries are also provided to access Windows functionality directly instead of through a Unix compatibility layer. Of course MingW will likely require you to convert quite a bit of your source code to access more or less different functions in order to work on a Win32 API environment instead of a Unix API.
But as long as you do not want to call LabVIEW external code manager functions (DSNewHandle() etc) from your C code, any compiler that can create shared libraries that export functions (in contradiction to Visual Basic for instance which creates by default DLLs that export an automation interface) should be possible to be called through the Call Library Node. If you want to access LabVIEW external code manager functions you need to have a compiler that can use one of the two priveded link libraries labview.lib (COFF) or labview.sym.lib (OMF) in the cintools directory.

Rolf Kalbermatter

Message Edited by rolfk on 04-17-2007 07:38 AM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 5 of 5
(3,947 Views)