Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Run-Time errors using DAQmx and Borland C++ Builder 5.0

I've written a simple program on MS Visual C++ 6.0 to test my PCI-6014 board and it works fine.
I copied the code to Borland C++ builder 5.0 and had some linker problems with the .lib files that where solved with borland's "coff2omf".
Now I've been getting run-time errors when I use the function DAQmxCreateAIVoltageChan()... The error code is -50251: "The specified software component is not available. The component was not loaded".
But I'm sure that the code is right, since it works fine on MS Visual C++ 6.0!

That the part of the code where I'm getting the error:
iErro = DAQmxCreateTask("", &thTask);
iErro = DAQmxCreateAIVoltageChan(thTask, "Dev1/ai0", "", DAQmx_Val_Diff, -10.0, 10.0, DAQmx_Val_Volts, NU
LL);

Thanks for the help,
Marcelo
0 Kudos
Message 1 of 5
(3,466 Views)
Hello

Borland enables certain types of exceptions by default which are initially disable in MSVC. You will need to refer to the documentation for Borland Builder on how to disable floating point exceptions. I believe you can do it by adding the following statement to your initialization code, but you should double check this:

_control87(MCW_EM, MCW_EM);

These exceptions get thrown because we are doing some floating point initialization underneath. This is not an indication of a bug or a problem of any sort. Apparently you have to this for alot of libraries to work correctly with Borland (OpenGL etc...)

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
Message 2 of 5
(3,466 Views)
Thanks a lot for the help. I used the exact command and it worked perfectly.

The sample code on Borland's help is:

#include
main() {
_control87(MCW_EM,MCW_EM);
.
.
.
}

Thanks again,
Marcelo Vieira
0 Kudos
Message 3 of 5
(3,466 Views)
Good answer - I had this problem as well when trying to call NIDAQmx functions from Borland Delphi. The solution was to do something like this:

asm
finit;
wait;
end;
... call NIDAQmx function here
Set8087CW(default8087CW);
0 Kudos
Message 4 of 5
(3,466 Views)
Good answer - I had this problem as well when trying to call NIDAQmx functions from Borland Delphi (5.0). The solution was to do something like this:

asm
finit;
wait;
end;

call NIDAQmx function here

Set8087CW(default8087CW);
0 Kudos
Message 5 of 5
(3,466 Views)