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.

Using the DLPC200 API with C++ (lightcommander)

Other Parts Discussed in Thread: DLPC200

Hi, I want to write a program to control the lightcommander in order to make the process more real time.

At this point I am trying to link the API library to the C++ project.

I have followed the steps in the API programmer's guide, and downloaded the 4 files (header, 2 dlls, and the lib) and have linked just the header and the lib through the project property as instructed.

I am having trouble with how to link the .dlls, as I believe that the implicit linking method shown in the guide was only for the .lib.

I am using visual studio 2010.

Again, my goal right now is to be able to use the provided APIs directly in the C++ code, and a detail step by step instructions would be greatly appreciated.

Thank you,

Yuma

  • Hi Tsuboi,

    Welcome to DLP & MEMS forum.

    First, the DLL and libraries are generated using Visual Studio 2008 version. You should be able to find how to use older version DLLs on Visual Studio 2010 environment.

    Second, from this link http://focus.ti.com/docs/toolsw/folders/print/dlpr200.html you can find simple application projects (Reference Application Source Code for DLPC200 API link) you can download and try these first. You can start your development from here.

    Again, the reference projects are created from VS 2008 you can find over the net on how to migrate these to VS2010.

    Let me know if you still face any problem.

    Regards,

    Sanjeev

     

     

  • Hi, I have managed to link the dll with my C++project.

    Right now I am just trying to display single image with the projector, and I am following the basic algorithm of the sample code that was provided.the algorithm is:

     

    1. Initialize API

    2. Download the .dbi image to the LC DDR

    3. Display using DLP_Display_DisplayPatternAutoStepRepeatForMultiplePasses()

    4. Stop display using DLP_Display_DisplayStop ()

     

    The problem is, the code runs perfectly smoothly, but displays only the checkerboard(that was on since I turned on the LC itself) pattern until I reach step 4 (I have system("PAUSE") after every step so that i can see each effect).

    At step4 the project stops projecting, so the program is communicating successfully with the LC (also since no error is produced while running the code).

    So the problem that seems apparent is  step3, although the API is successfully executed, there are no image being displayed.

    The .dbi image that I am using was generated by the LC control software (I followed the instructions in another thread about dbi).

     

    Also during another run where the projector was not displaying anything in the beginning(due to step4 from previous run), the checkerboard is displayed when it hits step3, and for step4 the projector stops displaying.

     

    Any ideas?

    Thanks in advance,

    Yuma

     

  • Hi Yuma,

    I undestand the problem you are facing and the behavior is expected.

    This is happening because you have not configured the LightCommander completely to display a pattern from DDR memory. To configure you will need to use LightCommander GUI software.

    Follow below steps to get it working -

    1) Create a project and add a "structured light" solution you can chose 1bpp. You can add any test pattern in the project.

    2) Hit Play button (compile + run)

    3) You can see there is series logs generated to display the pattern will be display test pattern .

    From above steps (1) to (3) the system is configured to display the pattern from DDR memory.

    Now, you can run APIs from your application

    a. Download the .dbi image to the LC DDR (after this command you can see that this pattern is displayed over the test pattern). I am assuming you are using Status WriteExternalImage (String name, Byte imageIndex) API with imageIndex = 0;

    b. Display using DLP_Display_DisplayPatternAutoStepRepeatForMultiplePasses()

    c. Stop display using DLP_Display_DisplayStop ()

  • Thank you for your reply. Now the LC is projecting the downloaded image properly.

     

    My concern is that do I have to initially configure the Lightcommander through the software? My goal is to control the LC completely by code. Are there any APIs or something lilke that which would give the equivalent performance?

     

    Thank you,

    Yuma

  • Hi Yuma,

    The APIs meant for real time control of the kit. The "configuration" data generation is a standalone  process and it has to be done with LightCommander GUI control only.

    If you have used GUI software you can easily generate configuration data one time and store into onboard flash memory. Entired "Configuration" file contains 1-project with "N" number of "solutions" in it. Each "solution" is typically a configuration by it self.

    Now, there is an API to switch between the configurations using DLP_RegIO_InitFromParallelFlashOffset API

    Refer this link which talks about selecting a solution http://e2e.ti.com/support/dlp__mems_micro-electro-mechanical_systems/f/94/p/122414/436859.aspx#436859

    Regards,

    Sanjeev