03-05-2012 03:21 PM
A little background. I work in test area where we deal with several different data acquisition systems and, therefore, several different raw test data file formats. One of those data types is NI/Diadem TDM files. I have developed a single raw data loading function, using MATLAB, to handle the importation/reading of all of the different data types. For the TDM files, I am utilizing the nilibddc.dll library (provided by National Instruments) to open/read the data files. When I run the MATLAB code from the MATLAB development environment everything works fine. This is the good news.
The bad news happens when I compile the MATLAB code and try to load TDM files into MS Excel. What I am doing is using MATLAB’s compiler/deployment tool to create a generic COM dll (called MATLABLoadDataFile.dll). I am then referencing MATLABLoadDataFile in an Excel add-in which obtains raw data file name(s) from the user, and calls the single raw data loading function to load the data into Excel. This allows the users to easily import to Excel, all of the different file types we deal with. When the raw data loading function is called in MATLABLoadDataFile, an error occurs (-6204 “Unexpected Error”) when the DDC_OpenFileEx function is called. I have included several debugging statements in the MATLAB code to try and track down what is going on. The findings….the nilibddc.dll appears to successfully load with MATLAB’s loadlibrary command. All 135 functions in nilibddc appear to be available. When DDC_OpenFileEx is called, the code -6204 “Unexpected Error” is thrown, and the load data file function is exited (via error checking code I wrote in MATALB) without loading any data.
Now, more good news (I guess). The above behavior is only experienced on my development machine, and (so far) one end-user. After I deployed the data loading Excel add-in to several (approx 5) end-users, I discovered that the TDM data loading function worked perfectly, without any errors being thrown. The sixth end-user, unfortunately, experienced the same “Unexpected Error” I receive on my machine. I have dug deep into several things to try and determine the common thread between my machine and the sixth user without any luck. I have checked system path statements, MATLAB path statements (if installed ), registry entries, and component install sequencing (I ran the same msi installer package for all end users). Before I continue further which the deployment, I would like more information on how/why the “Unexpected Error” occurs.
FYI, all of the computers are running 32 bit Windows 7, MS Excel 2007, & MATLAB r2010a (some machines have it installed already, and some do not. The MATLAB Compiler Runtime Library was installed on all machines to run the compiled MATLAB code. The 2 “problem” machines are different in this regard, as are the 5 “good” ones, so no common thread).
Any help or suggestions will be greatly appreciated. If this is the wrong forum for this question, please let me know, or forward to the correct one. Thank You.
Solved! Go to Solution.
03-06-2012 02:18 AM
Because the whole ddc system is based on dynaic library loading I would assume that one of them fails.
offers a tool depends.exe.
After starting it load the program (matlab.exe) to it and use the menu entry
The application will log all LoadLibrary and GetProcAddress entries and so on.
Have a look for red entries that might be related with ddc lib and ni usi.
A potential clash could be xerces or an installed NI-Excel Addin.
Could you check and come back with some information.
03-06-2012 09:07 AM
The depends.exe application (they need to change the name) was helpful in determining any differences between the "problem" and "good" computers (there where none).
However, your suggestion about Excel add-in conflicts was spot on. The 'National Instruments TDM Importer for MS Excel' add-in was causing conflicts. Disabled that and all is good. This was the common thing with the user experiencing the same problem. Should have seen this earlier (smack on head!)