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.

DLP9500: Connecting and controlling the DLP Discovery 4100 device using API, with D4100_usb.dll

Part Number: DLP9500
Other Parts Discussed in Thread: DLPC410, , , DLP7000, DLP7000UV, DLP650LNIR

Hi! 

I have a question about programmatically controlling the DLP Discovery 4100. Our team wants use the DLPC410 API to control the device from C++. We are currently trying the direct DLL control (not the ActiveX control). In my C++ file, I have included the header file D4100_usb.h, and I have linked the IDE (CodeBlocks) to the D4100_usb.lib file. Post compilation, I have placed the D4100_usb.dll file in the same directory as the compiled .exe file. Now, I am able to access the functions in D4100_usb.h from my program. But my program is not able to detect or control the D4100 board connected via USB. When I call the function GenNumDev() from my program, I get 0. 

Am I missing out some important step, like configuring a driver? I should mention that I am able to successfully control the board using the Discovery Explorer GUI.

Also, is it easier to use ActiveX controls instead? I am not very experienced in C++, and would prefer a simpler alternative.

 

Thanks!

Sharvaj

  • Hello Sharvaj,

    First, welcome to the DLP section of the TI-E2E forums.

    The response is correct.  I think that your understanding of the value returned is incorrect (probably due to an error in the API Guide which incorrectly states that, ". . . if you have four devices plugged in, GetNumDev( ) will return a '4'." 

    It will in fact return '3' ).  It returns the (number of boards attached - 1).  If you have 3 boards attached, it will return '2'. 

    Then you can address board #0, #1, or #2 when you call DLL functions. 

    In your case you will pass '0' as the 'DeviceNumber' for the one board you have attached.  

    For example if you want to know:

    • If the NSFLIP flag is set you would call GetNSFLIP(0) and it would return 0 or 1
    • If you want to find the DMD type you would call GetDMDTYPE(0) and it would return a number:
    • '0' - for DLP9500 / DLP9500UV [0.95" (Visible / UV) 1080p 2xLVDS Type A DMD]
    • '1' - for DLP7000 / DLP7000UV [0.7" (VisibleF / UV) XGA 2xLVDS Type A DMD]
    • '7' - for DLP650LNIR [0.65" (NIR) WXGA 2xLVDS S450 DMD]
    • ‘15’ – if a DMD is not attached or not recognized by the DLPC410 controller.

    I hope this helps.

    Fizix

  • Hi Fizix,

    Thanks a lot. Also, it turned out that I was using on older .dll file, so that I was getting GetDMDTYPE(0) as -1. But I was able to fix that and now I have GetDMDTYPE(0) = 0 which is correct DMD for me. 

    Also, I had a few follow-up questions:

    1. Do I need to program the FPGA every time I switch on the DMD? Or does starting the Explorer GUI do this automatically?
    2. For the function 'int LoadData(UCHAR* RowData, unsigned int length, short DMDType, short DeviceNumber) ', is the RowData a 2D array? I see that no more than 500 rows can be loaded at a time. So does this mean the array can be 500-by-(width of DMD)? Then the ' length ' will be the width of the DMD in pixels right?
    3. Is 'short GetRESETCOMPLETE(int waittime, short int DeviceNumber) ' the function for RESET? Is this the same as the ActiveX method 'Short Reset(short BlockNum)' ?

    Thanks a lot again!

    Sharvaj

  • Hello Sharvaj,

    Here are the answers:

    1. If you are using the newer version of the GUI/API, then the system come with a unified FPGA load.  In other words, it does not need to be loaded like it did with version 1.0 of the GUI
    2. Please refer tot the API Guide (DLPU039 - rev A) on page 10.  The minimum length is one row of data.  The instructions are a little confusing, but it you want to load 500 rows, you can call this function 500 times, but it is easier to call this function and hand it an array that is equal to a multiple of the width of the DMD in pixels (up to 500 rows).  For example if you have the XGA this would be 1024 pixels in one row * 500 rows = 512,000 for  the length.  So you would hand the DLL function LoadData(UCHAR* RowData, long length) a pointer to your UCHAR array and 512,000 as a long integer.
    3. The ActiveX Short Reset(short BlockNum) actually executes a reset on the block(s) specified by Block Mode and Block Address.  There is no direct equivalent in the DLL control functions.  Instead a Reset operation using DLL functions consists of setting the Row Mode to NoOp [§ 6.2.10], the Block Address to the desired block(s) [§ 6.2.6], the Block Mode [§ 6.2.4], you may also need to set RST2BLKZ if using dual block [§ 6.2.8], and then calling Load Control [§ 6.2.1] to write these values to the DMD.  I have found in practice that calling Load Control three times consecutively ensures that it writes over the USB interface. 

    I hope this helps.

    Fizix