This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DDC4100 ActiveX control using Matlab

Hello,

I'm trying to use Matlab to control the DDC4100. I've located the D4100_usb.dll file and all the header files "*.h" under my C:\WINDOWS\system32 folder. Matlab seems to load these files successfully using the loadlibrary function. Then I used actxcontrol to define the DMD via Active X and that works too. But when I listed the methods under this class, the ones that are in the API manual didn't show up. There are no basic methods such as GetDevice etc. What is the problem?

What should I do after loading the D4100_usb.dll file? How do I call functions such as loading images to DMD?

Please help. Thanks!

Siqi

  • Siqi,

    You will need the DLP® Discovery™ 4100 Controller Board API Programmer's Guide from MySecureSoftware.  If you do not have access to this area, please contact the Design Partner that the kit was purchased from and request access.This document spells out which functions are available to the DLL.

    You will be interested in the DLL funtion "GetDescriptor".  I know that this works because at one time there was Labview 7.1 code that used only the DLL.

    I hope this helps.

    Fizix

     

  • Hello Fizix,

    Thank you for your response! I already have the document. The problem is that after I loaded the dll file to Matlab, it does not show any of the functions listed in the document. Do you think I might have got the wrong file? I used the "D4100_usb.dll" file but it doesn't work. I got the file from a former student who was working on this project.

    Siqi

  • Siqi,

    That should be the correct file, but you don't use "GetDevice", instead the, "GetDescriptor" is the dll method of opening a device.  I believe that the ActiveX "GetDevice" call the "GetDescriptor" dll function to open a device.

    I am out of the office thiw week at a trade show and will not be able to verify this until I return to the office next week.

    Fizix

  • Hi Fizix,

    I understand that I should call functions from Ch. 5 instead of Ch. 4 from the API user guide. In the meantime, I suspect that the issue has to do with where I put the header files. I also contacted Matlab to see if they have an answer. If you could look into this after you return to office I would really appreciate it!

    In the meantime, do you know of any one who has done this with Matlab? Could you put me in contact with someone who has similar experience?

    Siqi

  • Hello,

    I think part of the problem was that I should not put the DLL or header files under WINDOWS/system32. I moved them to a different folder and now the only errors I have are "functions not found".

    > In loadlibrary at 275
    Warning: The function 'bOpenDriver' was not found in the library
    > In loadlibrary at 319
    Warning: The function 'ParseDeviceDescriptor' was not found in the library
    > In loadlibrary at 319
    Warning: The function 'ParseConfigurationDescriptor' was not found in the library
    > In loadlibrary at 319
    Warning: The function 'DumpBuffer' was not found in the library
    > In loadlibrary at 319
    Warning: No functions found in library.

    I'm using Windows XP and Matlab R2006B, with Lcc C version 2.4.1 in C:\PROGRA~1\MATLAB\R2006b\sys\lcc. Here is a thread I created on Matlab forum ()

    Could you help with this?

    Siqi

  • Hello Siqi,

    I have verified in Labview 7.1 that you call int program_FPGA(uchar* write_buffer, long write_size, short int DeviceNumber) where write_buffer is the contents of the D4100_GUI_FPGA.bin file (or your custom FPGA bin file) loaded into a 1 byte per element) array, write_size is the length of the write_buffer array in bytes, and DeviceNumber is the number of the attached D4100 board.  If only one board is attached then this will be 0.  If more than one board is attached then 0 will be the first attached, 1 will be the 2nd attached, etc . . .

    I have verified that this works in Labview.  I don't think you should move the dll from its default location.  Making the call from MatLab may take working with or inquiring on the MatLab forums on how to properly prototype the dll call.

    [EDIT - If you succeed, the LED by the smaller FPGA (LX30) should go red for a second or two and then green again]

    This is the only information I have.  I hope this gets you rolling.

    Fizix

  • Hi Fizix,

    Thanks for verifying this.

    I'd like to ask you again where to get the relevant dll and header files. I got them from a former student who is no longer working here, and I don't know where she got them from. Could you please provide me information where to ask for them?

    Thanks.

    Siqi