Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the library nidaqmx.lib be used with the WATCOM C compiler?

Hi,

 

I am trying to convert some legacy code to use NI-DAQmx functions. The DAQmx library (nidaqmx.lib) appears to be intended for Microsoft Visual C. Unfortunately, we are using the WATCOM C/C++ version 11 compiler. Is this library compatible with the WATCOM linker?

 

This issue came up because I am using a MATALB Mex function to call the DAQmx routines. When I try to compile the code I get the following error:

 

 >> mex selfcal_ni4472.c nidaqmx.lib

The instruction at 0x69c16ed0 referenced memory at 0x003d8000.

The memory could not be read.

 

  C:\MATLAB71\BIN\MEX.PL: Error: Link of 'selfcal_ni4472.mexw32' failed.

 

??? Error using ==> mex

Unable to complete successfully

 

But when I comment out the one call to the DAQmx routine there are no errors. In the past I was able to compile the Mex file with the same compiler when legacy DAQ calls were used.

 

Thanks.

0 Kudos
Message 1 of 4
(7,557 Views)
Sebulba,

I am not familiar with the WATCOM compiler, but this error may have something to do with its default calling convention. The default for DAQmx is stdcall (as opposed to cdecl). Do you know what WATCOM uses?

Alternatively, if you are trying to use DAQmx in Matlab, this post may help explain how you can set this up.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 4
(7,545 Views)
Hi Ryan,
 
Thanks for the reply. I do not know the calling convesnion used by the WATCOM compiler. But the link to the post that you provided is very interesting. I will try to call the DAQmx library funcitons directly from MATLAB rather than trying to figure out this compiler issue. Many thanks.
 
Regards,
 
Sebulba
0 Kudos
Message 3 of 4
(7,543 Views)
Sebulba,

Sounds great! Good luck accessing DAQmx directly from Matlab. If you do decide to continue using the WATCOM compiler, please post your results.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 4 of 4
(7,538 Views)