Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI-DAQ C/C++ API's with Visual Studio .NET

I am trying to use traditional NI-DAQ with my 6533 DIO card. The documentation says that the card is not supported for Measurement Studio, so I am trying to use the bare C API and link to the libs in NI-DAQ\Lib according to the documentation. I manage to get an executable by compiling an example, but when the program is run, i get the following error message in a popup: "The application failed to initialize properly (0xc0000142)." I am running as a normal user under Windows XP and using NI-DAQ 7. This error even appears if the main() is empty, but does not appear if the libraries are not included in the link. I am using Visual Studio .NET 2003 to produce C or C++ application. Please help.
0 Kudos
Message 1 of 3
(3,323 Views)
Hi,
apologies for the delay.
The error is usually down to a bad install of NI-DAQ.
Can you post your code here, so I can try it on my machine, and then we should be able to narrow it down to a PC / Install / Driver issue.

One thought is that you're trying to access the driver from a couple of places at once, and this is causing a problem :
When you attempt to use NI-DAQ 6.x (or 7.x Traditional) from multiple applications or in conjunction with other NI hardware drivers, NI-DAQ may fail to load if it is unable to acquire the necessary resources.

The usual recommended solution is to migrate to the new NI-DAQmx 7.x driver where this issue has been fixed, however, your 6533 is currently only supported under the Traditional portion.

Otherwise, to resolve this issue using NI-DAQ 6.x or 7.x Traditional, proceed sequentially through the following list of possible solutions. After trying each solution, attempt to reproduce the issue. If the issue has not yet been resolved, proceed to the next solution in the list.

Shut down all applications that are using NI-DAQ (examples include MAX, LabVIEW, Measurement Studio, Visual Studio). Now try loading your applications in a different order - in particular, try loading the application that gave you the error first.

Update to the latest version of NI-DAQ.

Update to the latest versions of all other National Instruments drivers used by the target system.

Download the palBase utility attached below to your Windows folder, C:\WINDOWS for Windows 95, 98, ME, or C:\WINNT for Windows 2000 and XP. The palBase utility allows you to fine tune the way that NI-DAQ acquires resources from the system by making changes to both the drivers and the registry.

To execute the palBase application from a DOS command prompt:

a. Go to the Start menu and select Run.
b. Type command and press Enter.
c. In the command prompt window, type palBase -b 64000000 -s 44000000 and press Enter.
d. Reboot the system and try your applications again. If the issue is resolved, you may delete the palBase utility.

Repeat 4. This time, at the command line, type palBase -b 44800000 -s 45800000

Repeat 4. This time, at the command line, type palBase -b 32800000 -s 36800000 -d 18400000

Repeat 4. This time, at the command line, type palBase -b 33400000 -s 35400000 -d 34400000


If the issue remains, or if palBase reports an error, please contact National Instruments Technical Support at the link below.

To restore your system to default values, open a DOS command prompt as explained in Option 4 above, type palBase -b 64000000 -s 0 -d 21000000, and press Enter


Thanks

Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 3
(3,283 Views)
>> I am running as a normal user under Windows XP

Actually, I think that this is the issue. Can you see if your program loads if you're running as an administrator? If so then the links below should help solve your problem:

Link 1
Link 2

Good luck,
Joe
0 Kudos
Message 3 of 3
(3,279 Views)