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.

DLP4500二次开发代码设置sequence问题

Other Parts Discussed in Thread: DLPC350, DLP4500

我自己编写的代码,在已经用GUI随便设置一次sequence后,再拿我的代码设置就可以,没有问题,但是如果断开连接一段时间,再次连接投影仪,我的代码设置进去的就不对了,sequence里pattern和曝光周期就不是我设置的,重新拿GUI随便设置一次sequence代码就又可以用,我想问问是我的代码还有什么前期设置没有做么?代码和出错后读取上来的序列周期如下:

我是拿八张一位的图合成一张24位的图,然后sequence是取G0-G7循环来用。

int main()
{


 int ret = -1;
 if (DLPC350_USB_IsConnected())
 {
  ret = DLPC350_USB_Close();
  if (ret != ExcuteSuccess)
  {
   cout << "USB close  Fail,ret =" << ret << endl;
  }
  else
  {
   cout << "USB close  Success,ret =" << ret << endl;
  }
 }

 ret = DLPC350_USB_Init();
 ret = DLPC350_USB_Open();
 if (ret != ExcuteSuccess)
 {
  cout << "USB open Fail,status =" << ret << endl;
 }
 else
 {
  cout << "USB open Pass,status =" << ret << endl;
 }

 //unsigned int patMode;
 int numLutEntries = 0;
 unsigned int status;
 unsigned char splashLut[64];
 int numSplashLutEntries = 0;
 unsigned int numPatterns;
 
   
 int i = 0;
 DLPC350_SetMode(true);
 DLPC350_ClearPatLut();
 
 unsigned long int g_PatLut[MAX_PAT_LUT_ENTRIES] = { 0 };
 unsigned int g_PatLutIndex = 0;

 
 g_PatLut[0] = 0x67100;
 g_PatLut[1] = 0x27104;
 g_PatLut[2] = 0x27108;
 g_PatLut[3] = 0x2710c;
 g_PatLut[4] = 0x27110;
 g_PatLut[5] = 0x27114;
 g_PatLut[6] = 0x27118;
 g_PatLut[7] = 0x2711c;
 g_PatLut[8] = 0x27100;
 g_PatLut[9] = 0x27100;
 g_PatLut[10] = 0x27100;
 g_PatLut[11] = 0x27100;
 g_PatLut[12] = 0x27108;
 g_PatLut[13] = 0x2710c;
 g_PatLut[14] = 0x27110;
 g_PatLut[15] = 0x27114;
 g_PatLut[16] = 0x27118;
 g_PatLut[17] = 0x2711c;
 g_PatLut[18] = 0x27100;
 g_PatLut[19] = 0x27104;
 g_PatLut[20] = 0x27108;
 g_PatLut[21] = 0x27104;
 g_PatLut[22] = 0x27108;
 g_PatLut[23] = 0x2710c;
 g_PatLut[24] = 0x27110;
 g_PatLut[25] = 0x27114;
 g_PatLut[26] = 0x27118;
 g_PatLut[27] = 0x2711c;
 g_PatLut[28] = 0x27100;
 g_PatLut[29] = 0x27104;
 g_PatLut[30] = 0x27108;
 g_PatLut[31] = 0x27104;
 g_PatLut[32] = 0x27108;
 g_PatLut[33] = 0x2710c;
 g_PatLut[34] = 0x27110;
 g_PatLut[35] = 0x27114;
 g_PatLut[36] = 0x27118;
 g_PatLut[37] = 0x2711c;
 g_PatLut[38] = 0x27100;
 g_PatLut[39] = 0x27104;
 g_PatLut[40] = 0x27108;
 g_PatLut[41] = 0x27104;
 g_PatLut[42] = 0x27108;
 g_PatLut[43] = 0x2710c;
 g_PatLut[44] = 0x27110;
 g_PatLut[45] = 0x27114;
 g_PatLut[46] = 0x27118;
 g_PatLut[47] = 0x2711c;
 g_PatLut[48] = 0x27100;
 g_PatLut[49] = 0x27100;
 g_PatLut[50] = 0x27100;
 g_PatLut[51] = 0x27100;
 g_PatLut[52] = 0x27108;
 g_PatLut[53] = 0x2710c;
 g_PatLut[54] = 0x27110;
 g_PatLut[55] = 0x27114;
 g_PatLut[56] = 0x27118;
 g_PatLut[57] = 0x2711c;
 g_PatLut[58] = 0x27100;
 g_PatLut[59] = 0x27104;
 g_PatLut[60] = 0x27108;
 g_PatLut[61] = 0x27104;
 g_PatLut[62] = 0x27108;
 g_PatLut[63] = 0x2710c;
 g_PatLut[64] = 0x27110;
 g_PatLut[65] = 0x27114;
 g_PatLut[66] = 0x27118;
 g_PatLut[67] = 0x2711c;
 g_PatLut[68] = 0x27100;
 g_PatLut[69] = 0x27104;
 g_PatLut[70] = 0x27108;
 g_PatLut[71] = 0x27104;
 g_PatLut[72] = 0x27108;
 g_PatLut[73] = 0x2710c;
 g_PatLut[74] = 0x27110;
 g_PatLut[75] = 0x27114;
 g_PatLut[76] = 0x27118;
 g_PatLut[77] = 0x2711c;
 g_PatLut[78] = 0x27100;
 g_PatLut[79] = 0x27104;
 g_PatLut[80] = 0x27108;
 g_PatLut[81] = 0x27104;
 g_PatLut[82] = 0x27108;
 g_PatLut[83] = 0x2710c;
 g_PatLut[84] = 0x27110;
 g_PatLut[85] = 0x27114;
 g_PatLut[86] = 0x27118;
 g_PatLut[87] = 0x2711c;
 g_PatLut[88] = 0x27100;
 g_PatLut[89] = 0x27100;
 g_PatLut[90] = 0x27100;
 g_PatLut[91] = 0x27104;
 g_PatLut[92] = 0x27108;
 g_PatLut[93] = 0x2710c;
 g_PatLut[94] = 0x27110;
 g_PatLut[95] = 0x27114;
 g_PatLut[96] = 0x27118;
 g_PatLut[97] = 0x2711c;
 g_PatLut[98] = 0x27100;
 g_PatLut[99] = 0x27100;
 g_PatLut[100] = 0x27100;
 g_PatLut[101] = 0x27104;
 g_PatLut[102] = 0x27108;
 g_PatLut[103] = 0x2710c;
 g_PatLut[104] = 0x27110;
 g_PatLut[105] = 0x27114;
 g_PatLut[106] = 0x27118;
 g_PatLut[107] = 0x2711c;
 g_PatLut[108] = 0x27100;
 g_PatLut[109] = 0x27100;
 g_PatLut[110] = 0x27100;
 g_PatLut[111] = 0x27104;
 g_PatLut[112] = 0x27108;
 g_PatLut[113] = 0x2710c;
 g_PatLut[114] = 0x27110;
 g_PatLut[115] = 0x27114;
 g_PatLut[116] = 0x27118;
 g_PatLut[117] = 0x2711c;
 g_PatLut[118] = 0x27100;
 g_PatLut[119] = 0x27100;
 g_PatLut[120] = 0x27100;
 g_PatLut[121] = 0x27104;
 g_PatLut[122] = 0x27108;
 g_PatLut[123] = 0x2710c;
 g_PatLut[124] = 0x27110;
 g_PatLut[125] = 0x27114;
 g_PatLut[126] = 0x27118;
 g_PatLut[127] = 0x2711c;

 splashLut[0] = 0x0;
 

 numSplashLutEntries = 1;
 numLutEntries = 128;
 numPatterns = 128;
 g_PatLutIndex = 128;
 
 DLPC350_PatternDisplay(0);

 DLPC350_SetPatternDisplayMode(false);

 DLPC350_SetPatternConfig(numLutEntries, false, numPatterns, numSplashLutEntries);

 DLPC350_SetLongAxisImageFlip(false);
 DLPC350_SetShortAxisImageFlip(true);
 
 unsigned long int exposure_time = 10000;
 unsigned long frame_petiod = exposure_time + 00000;
 DLPC350_SetExposure_FramePeriod(exposure_time,frame_petiod);
 
 
 DLPC350_SetTrigIn1Delay(1);
 DLPC350_SetTrigOutConfig(1,false,187,187);
 DLPC350_SetTrigOutConfig(2, false, 187, 187);

 DLPC350_SetRedLEDStrobeDelay(187, 187);
 DLPC350_SetGreenLEDStrobeDelay(187, 187);
 DLPC350_SetBlueLEDStrobeDelay(187, 187);
 
 ret=User_SendPatLut(g_PatLut,g_PatLutIndex);
 if (ret != ExcuteSuccess)
 {
  cout << "SendPatLut Fail,status =" << ret << endl;
 }
 DLPC350_SendImageLut(&splashLut[0], numSplashLutEntries);
 
 DLPC350_SetLedEnables(true, false, false, false);
 DLPC350_SetLEDPWMInvert(false);
 DLPC350_SetLedCurrents(150, 135, 130);
 DLPC350_SetLedEnables(true, true, true, true);

 bool ProjectControl = true;
 int count = 0;
 while (count<10)
 {
  DLPC350_ValidatePatLutData(&status);
  DLPC350_PatternDisplay(2);
  Sleep(frame_petiod*g_PatLutIndex/1000-330 );//毫秒
  count++;
  
 }
 
 

 system("pause");
 return 0;
}