I am preparing a python interface code for DLP NIRscan Nano EVM through USB.
So far, it is going moderate, except for a few confusions here and there. I am reading reference code and user guide while doing it.
Currently, I can connect, start scan, adjust a few parameters (do not need all), retrieve scan data correctly and graph it.
However, I've encountered a couple of problems that give me trouble. They are related to some NNO_CMD_... commands. Here is my usual scan workflow (as suggested by the user guide dlpu030g.pdf);
1- Send NNO_CMD_SCAN_SET_ACT_CFG
2- Send NNO_CMD_SCAN_SCAN_NUM_REPEATS (and read response although I do not need the response)
3- Send NNO_CMD_SCAN_READ_SCAN_TIME and read the response
4- Send NNO_CMD_SCAN_PERFORM_SCAN (with no storage to SSD option)
5- Send NNO_CMD_READ_DEVICE_STATUS to see if the scan is completed.
6- If the scan is completed, send NNO_CMD_FILE_GET_READSIZE
7- Using the file size obtained in step-6, repeatedly send NNO_CMD_FILE_GET_DATA to retrieve entire scan-data.
First problem is on NNO_CMD_SCAN_NUM_REPEATS command. Unless a response is requested (bit-6) and the response is read (although it is actually useless), device does not conform to requested scan repeats and goes on with the configuration set previously by NNO_CMD_SCAN_SET_ACT_CFG command. Why is it so? Why am I forced to request response with NNO_CMD_SCAN_NUM_REPEATS command?
The second problem is on NNO_CMD_READ_DEVICE_STATUS command. I use this command to see if the scan is completed. Command seems to work correctly. However, as soon as I get bit-1 zero on the returned 4 byte response (meaning that the scan is completed), I am no longer be able to retrieve the scan-data. It seems that this command (with completion of scan) clears the scan-data. If I do not send this command and instead wait for the lamp to turn off, I can retrieve the scan-data correctly. Interesting thing is that when NNO_CMD_READ_DEVICE_STATUS command returns "scan is not completed yet" I am able to read the scan-data after waiting for a few seconds.
Can anybody help me with these problems?
(I also have problem with hibernation commands but somewhat avoided them by asking time to EVM every 4 minutes )