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.

DLP freezes after 10 frames (More Inquiries)

Sanjeev,

Walter and I are working in this project, and implementing the code together. Here are few things that are still not working alright.

1- Suppose, I run this code:

tcpObject = tcpip(192.168.1.100,Port Number)

fopen(tcpObject);

count = 1

while count < 20

fwrite(tcpObject,uint8(hex2dec(['02';'01';'01';'00';'01';'00';'00';'05']))); %switch display mode to static

fwrite(tcpObject,uint8(hex2dec(['02';'01';'03';'00';'01';'00';'00';'07']))); %switch to internal pattern: checkboard

end

I don't exactly remember what I exactly used in these two lines, but I am sure I tried to execute two different patterns one after another. If I try to execute this code, after a while, the lightcrafter keeps projecting these patterns sequentially, even though I exit MATLAB.

Now, this might mean that too many data get in the LightCrafter buffer, while the code above executes, and the lighcrafter keeps projecting the data even though MATLAB is closed. Following your comment, if I try to execute after each of the lines above as follows:

ack = fread(tcpObject),

I read some bytes. Please let me know which of these bytes will let me know there is no error and I can send the next set of data.

2- It will be good if I learn how to clean the memory of lightCrafter. I think the problem is we are sending too many data; they are getting occupied in lightCrafter memory; and eventually lightCrafter gets frozen. I may be wrong, but I would expect that the new data should replace the old data, and due to this, old data should be removed from the lightCrafter memory. Question is how can I delete things from the lightCrafter memory.

fwrite(tcpObject,uint8(hex2dec(['02';'06';'01';'00';'01';'00';'00';'10']))); %switch display mode to static

This did not work.

3- We tried to power off the red and blue LED and keep only the green LED on. We used:

fwrite(tcpObject,uint8(hex2dec(['02';'01';'04';'00';'06';'00';'00';'00';'01';'0C';'00';'00';'26']))); %switch display mode to static

It did not work. For data bytes, we used '00';'00' to keep the red and green LED off, and '01';'0C' as 112 in hex to send 633 mA as specified for the green LED to let it remain on.

It did not work.

4- Finally, it could be just that the lightCrafter that we have has some hardware issues. It may be a faulty module that we have. Please let us know what would be our quick test to know that the projector is working as expected....

We appreciate your quick response.

Many thanks,

Pinaki

  • Hello Pinaki,

    Have answered your questions below.

    #1.

    The command response packet is described in the DLP® LightCrafter™ DM365 Command Interface Guide section 2 Packet Structure. You can categorize commands into two basic groups namely WriteCommands and ReadCommands. For the write commands the response packet will be short and for read type commands the response packet will include the information requested in the payload.

    Now below ones are 'write type' commands.

    fwrite(tcpObject,uint8(hex2dec(['02';'01';'01';'00';'01';'00';'00';'05']))); %switch display mode to static
    fwrite(tcpObject,uint8(hex2dec(['02';'01';'03';'00';'01';'00';'00';'07']))); %switch to internal pattern: checkboard
     

    Logic to read the response -

    a. Read 6-bytes header

    b. Check Byte0/Packet Type value verify it is returing what is expected, for example - 0x02 write command the response would be 0x03 - write response similarly if it is 0x04 - read command then it will be 0x05 read response. In case if you receive 0x00 - Busy or 0x01 - Command Error Packet then command not executed successful either LightCrafter busy not ready to accept command or your command packet itself has eror in it.

    So, follow the documentation and analyze 6-bytes HEADER.

    The next step would be to determine how many number of bytes to read, which will be "Payload length" + 1 for check sum. You can simply read  [(Byte5<<8+Byte4) + 1] number of bytes.

    Also validate correctness in the packet by running checksum calcuation

    Checksum = (Byte_0 + Byte_1 + … Byte_N-1) MODULO[ 0x100 ] where Checksum byte is last byte Byte_N

    #2.

    There is no way to clear the LightCrafter command memory. You must follow the protocol for communicating with the hardware. For any command there is a response and you must read a response before sending the next command. Also analyze the response packet to take next action on what to be sent.

    #3.

    For 633mA it is 0x112 i think you have interpreted 112 as decimal. Please try below sequence it will work. Also make sure you are reading the response back.

    fwrite(tcpObject,uint8(hex2dec(['02';'01';'04';'00';'06';'00';'00';'00';'12';'01';'00';'00';'20']))); %Set LED current RGB 0,633mA,0 respectively

    #4.

    In your development the new part is the MATLAB side code, i would suggest do simple tests with the LightCrafter GUI run simple test like changing Display Mode, change currents if it works then it is good.

    Regards,

    Sanjeev