02-28-2009 06:05 PM
I've started on my very first CVI project and would appreciate some pointers regarding which functions are portable to Linux or not.
I understand that W32 API calls are taboo, that's a no-brainer but the NI guidelines are to program in pure "ANSI C". What does this mean exactly?
Can i use Fmt and Scan functions and still expect theprogram to compile under windows?
I need VISA on Linux, so I'm assuming all VISA functions are portable?
I'm a seasoned LabVIEW programmer but this is my first CVI project.
Shane.
03-02-2009 03:40 AM
03-02-2009 04:06 AM
Guilaume,
thanks for the info. I just found out today that the RTE installs basically everything I'm using (Everything visible in a default installation of CVI).
I have installed no other libraries, so I suppose my program should be protable as-is?
Are there any specific conventions I need to adhere to to keep things portable? What about DLLs, or shared libraries? Can I create a shared library for Linux using the same source code for a Windows DLL if I use the DLLEXPORT macro?
Sorry for the noob questions, but I AM a n oob in this area.
Shane.
03-03-2009 05:44 AM
Hi,
here you get a link about what you can do in CVI Linux: http://zone.ni.com/devzone/cda/tut/p/id/2823
In Linux, shared libraries are called "shared object" files and end in a ".so" extension. You can use the gcc compiler to create one.
Check out the following link:
http://www-106.ibm.com/developerworks/linux/library/l-dll.html?dwzone=linux
Or you will need to recompile your shared library in CVI Linux. Then you can call this shared library there.
03-03-2009 07:10 AM
03-03-2009 08:00 AM
@DianaS, which functionality can I use with gcc? I was just reading up on this and it seems I need to buy a specific CVI compiler for Linux but if it can work witrh gcc (I'm not using any UI stuff) then that's cheaper of course.....
@Guillaume, thanks for the info. I think I have enough information to be able to proceed with less fear now 🙂
Shane
03-03-2009 08:29 AM
Hi Shane
if you order CVI for Linux http://sine.ni.com/nips/cds/view/p/lang/de/nid/203157 you have a lot of more functions and can easily develop a graphical user interface. Also you have included the libraries for our hardware (DAQmx, visa, gpib...)
03-03-2009 08:58 AM
Diana,
if all I need is VISA and ANSI C, can I compile the program using gcc?
The VISA installation on Linux copies all the header files needed for VISA right?
Shane.
03-03-2009 09:09 AM
Hi,
I don't know if this will work and we don't support it.
03-03-2009 09:10 AM
Hi Diana,
The second part is clear (no support) but it's the first part which would interest me since you've mentioned it in an earlier post.
Shane.