LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Ni-Daq when changing compatibility mode between Visual and Borland

Hello,

I am working on two projects with CVI, one with Borland C/C++ compatibility and the other with Visual C/C++ compatibilty.

When i change of compatibilty mode in "Build option", i restart CVI but it is not able to load Ni-Daq in the new compatibility mode. I have to re-install Ni-Daq and it works.

It says in a pop-up:
"Aborted load library "c:\Program Files\National Instruments\CVI70\bin\dataacq.lib".The file format of "c:\Program Files\National Instruments\CVI70\bin\dataacq.lib" does not matchthat used by the current compatibily mode."
and
"Library 'Traditionnal Ni-DAQ Library' not loaded."

The same for "easyio.lib" but the other like Daqmx seems to be loaded without any problem.

I installed NiDaq trad 7.4.1.

Is there anything to do when installing Traditionnal ni-daq to have the both version installed?

Thanks
DanY
0 Kudos
Message 1 of 6
(3,257 Views)
Hi Dany27,
 
I belive that the different calling convension or stack access modes between Borland and Visual C caused this problem. I had a similar problem with a PC104 board driver.
 
Have you installed the DAQmx driver after CVI installed ? Probably some modifications have to made to your NIDAQmx.h, that can be found in X:\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include
 
In the beginning of this file, there must be written some lines like the following:
Would you please check if yours is identical to mine? (mine is VC++ compatitable)
 
#ifndef ___nidaqmx_h___
#define ___nidaqmx_h___
#ifdef __cplusplus
 extern "C" {
#endif
#ifdef __linux__
#define __CFUNC
#define __CFUNC_C
#define __CFUNCPTRVAR
#define CVICDECL
#define CVICALLBACK     CVICDECL
#else
#define __CFUNC         __stdcall
#define __CFUNC_C       __cdecl
#define __CFUNCPTRVAR   __cdecl
#define CVICDECL        __cdecl
#define CVICALLBACK     CVICDECL
#endif
0 Kudos
Message 2 of 6
(3,240 Views)
Hello, thanks for your answer but my problem doesn't come from my Daqmx library (no pb with it) but from my traditionnal NiDAQ (7.4.1) that i have to réinstall each time i change of project (and of compatibility mode).

The both compatibility mode seems to be managed by CVI but is the NiDAQ installation install the both versions of the libraries?

Thanks
DanY
0 Kudos
Message 3 of 6
(3,235 Views)
The compatibility mode changing works by copying the .lib file from the \parent\msvc (or \parent\borland) one directory up, into \parent. You should check to make sure that:
1) you have a version of the .lib file in both the \msvc and \borland directories, and
2) that they are not identical (maybe it accidentally got copied from the parent directory into the opposite subdirectory).

It's also possible that the lib fails to be copied during the compatibility mode change.  Make sure that you can delete the lib in the parent directory -- this will show that the file is not locked for some reason.

Mert A.
National Instruments
Message 4 of 6
(3,230 Views)
Hello,

Thank you very much for your help.
Yes it seems that the both lib i got problem with haven't its version neither in the msvc nor in the borland directory. That's why when i change of compatibility, it can't update these libs.

I'll fix this by hand but is it a bug in CVI or in the NiDaq package?

Thanks
DanY

Message Edité par Dany27 le 11-29-2006 01:02 PM

0 Kudos
Message 5 of 6
(3,227 Views)
Well, I have just discovered that this is a known behavior difference between Traditional DAQ and most other drivers.  Prior to CVI version 7.0, there was no compatibility mode switching; driver libs and CVI libs alike were only installed for one compatibility mode.  To change the mode you would have to rerun the driver (or CVI) installer and select the other compatibility mode.  Becase Traditional DAQ is a legacy driver, its installer was never updated to take advantage of CVI's post-install compatibility switching mechanism.

If you want to use the library in different compatibility modes, do the following:

1) Copy easyio.lib and dataacq.lib from \bin to \bin\msvc (assuming that MSVC is the mode for which the libraries successfully load) and
 from \extlib to \extlib\msvc. The libs in \bin and \extlib are actually different, so be sure to copy them separately.
2) Change CVI's compatibility mode to Borland.
3) Reinstall Traditional DAQ.
4) Repeat step 1, but copy the libs into the \borland subdirectories this time.

After all that, you should be in good shape.

Mert A.
National Instruments
0 Kudos
Message 6 of 6
(3,221 Views)