Happy New Year!!!
For a while we’ve used patchy solutions for controlling a digital micromirror device (DMD), first just by roughly changing the included API code, then a professional software engineer designed a beautiful but very complicated Java code to display patterns on the DMD. Aside from being possibly overcomplicated, this design is not so flexible for us as experimenters. Often our first designs of measurement patterns are carried out in Matlab before we export them to the other code that controls the mirrors. Now we have a new project where Matlab needs to read out a measurement, perform a calculation based on that measurement, and generate a new pattern to be displayed based on the outcome of the calculation. Now it’s my turn to generate a solution — good news: Matlab has built in functions to load the .dll needed to communicate with the DMD.
The first search I did on this subject came up with this post on the TI E2E Community page. Apparently someone was trying to do this with the newer 4000 kit that supports some .OCX/COM object shit that I really don’t know anything about. I searched around for a while, but then realized I just need to communicate with the libraries included with the API that came with our DMD chipset.
Then on codeproject.com, I found an entry, Connecting MATLAB to C-language DLLs. It seems matlab has built in functions to call functions contained in .dll files. For some more info on just what a .dll is, see wikipedia of course, and the microsoft site on how to compile a .dll from .h and .c is also illuminating. The latter I found with this google search: how to generate a .dll from c code.
I tried just running the code found in “Connecting MATLAB…” and got the error message:
??? Error using ==> loadlibrary at 282
Microsoft Visual C++ 2005 or 2008 is required to use this
feature
So now to remind myself how to check/install compilers in Matlab and hoping I can get Microsoft VC++ 2010 to work instead of 2005 or 2008…