01-27-2011 05:06 PM
I am using the USB-6501 to control an attenuator. I have written the driver to work with WinXP, but now that I am trying to use it on Win 7 64 bit, it is causing an error. At first it complained about not having C++ studio 2008 (we had 2010), and I have fixed that. Now it seems to be complaining about the DLL. I talked to NI, and they think that we need a different DLL for Win 7 64 bit.
Loading nicaiu.dll...
??? Error using ==> loadlibrary at 365
Failed to preprocess the input file.
Output from preprocessor is:'cl' is not recognized as an internal or external command,
operable program or batch file.
Error in ==> USB_6501_driver at 38
funclist = loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni');
Any help would be greatly appreciated.
Thanks,
Steve
01-27-2011 06:50 PM
Hi Steve,
It sounds like your program or one of the libraries it is using cannot find the 'cl' command. The 'cl' command is part of Microsoft Visual C++. (Also a part of the Windows SDK, Windows Driver Kit, etc.)
Brad
01-27-2011 07:45 PM
Hey Brad,
I have loaded up the proper C++ compilier - in this case is was asking for Visual C++ 2008. I have instlled it and selected it in MatLab, but I'm still getting the error. It seems like it is looking for .cpp file, but can't find it. The nocpp variable is set. Works fine on XP, but not Win7 64 - Very frustrating.
Thanks,
Steve
01-27-2011 07:53 PM
Hi Steve,
Does that mean you have solved the "'cl' is not recognized as an internal or external command..." error? If you are now getting a different error, I recommend posting the error text so that someone who knows Matlab (I do not) can help you.
Brad
01-28-2011 11:07 AM
Hey Brad,
No, I am still getting the same error from my original post. Nothing has changed. I was just pointing out that I already checked the C compilier, upgraded to most recent version of the driver, and set matLab to use Visual C++ 2008 as required by the driver. There still seems to be a library issue. I stepped through the code and the nocpp variable was set which causes it to drop into the code generating the error below. One thing that is different between the XP and Win7 computers is that on the XP machine I am running MatLab 2009a and on the Win7, we are running MatLab2010b. I sure wish one of the NI guys would have an answer to this post. Here's the error again:
Loading nicaiu.dll...
??? Error using ==> loadlibrary at 365
Failed to preprocess the input file.
Output from preprocessor is:'cl' is not recognized as an internal or external command,
operable program or batch file.
Error in ==> USB_6501_driver at 38
funclist = loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni');
Any help would be greatly appreciated.
Thanks,
Steve
01-28-2011 11:23 AM - edited 01-28-2011 11:25 AM
Hi Steve,
nicaiu.dll doesn't invoke the "cl" command. Based on your error message, I think that Matlab's loadlibrary command invokes "cl /E" in order to run the NIDAQmx.h file through the C preprocessor, but it can't find the cl.exe executable, so it never even gets to the point where it can run any NI-DAQmx code.
Brad Keryan
NI R&D
01-28-2011 11:29 AM
Hey Brad,
Yeah, it does seem to be in the preprocessor code section when it failes. I didn't know what "CL" represented, but that is interesting that you suggest it is an .exe file. I will search the XP machine to see if that file is present. I may go back and step the code on the XP machine to see what it does in the section that generates the error. It does seem to create some temporary files, but maybe you're right that it can't find the cl.exe (I thought cl was a variable) and so it can't continue loading up the NI-DAQmx code. Thanks for the tip...I'll check it out...
Cheers,
Steve
01-31-2011 05:44 PM
Steve,
Have you had a chance to look for the CL file on the XP machine or check the behavior of the working set up at the breaking point the new machine is seeing?
From going through the above, it does sound like there is some trouble finding and running the cl.exe file which is keeping the program from running further operations.
A quick web-search for "Matlab cl.exe" gave me several results for other people having trouble (with various other drivers or programs) with CL going missing, so it may not be a driver specific issue.
Timothy
02-01-2011 06:03 PM
Hi Tim,
I went and check to see if the cl.exe file was installed on the Win7 64 system, and it was found in the Visual C++ directory where I would expect it. I went back and stepped though the code on the working system and the failed system, and the problems seems to be when MatLab goes to make a call to the operating system. The variable comes back empty and that is why is droping into the failure message. Here's the code whre it fails:
if (~nocpp)
[res,ccout]=system(preprocess_command);
if (res==1)
error('MATLAB:loadlibrary:cppfailure',...
'Failed to preprocess the input file.\n Output from preprocessor is:%s',ccout);
end
if (regexpi(ccout,'warning|error','once') )
warning('MATLAB:loadlibrary:cppoutput','Message from C preprocessor:\n%s',ccout);
end
end
Thanks,
Steve
02-02-2011 02:50 PM
Hi Steve,
It does not appear from your code that this is an error involving the USB driver or any function calls for DAQmx, therefore this forum may not be the best resource to find a solution to this issue since it doesn't seem to be rooted in the driver functions.
Regards,
Justin