UPSNxr.cpp 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. #include "stdafx.h"
  2. #include "UpsNxr.h"
  3. #include "CommProcess.h"
  4. CUPSNxr::CUPSNxr(char *szPath,char *szIniName,int nCommPort, int nAddr,int nRate, int nDataBit,int nStopBit, int nParity,int nInterval)
  5. {
  6. #if IS_USE_READMSG_CS
  7. InitializeCriticalSection( &m_csReadMsg ); //初始化一个临界资源对象
  8. #endif
  9. MTVERIFY( m_hSemComm = CreateEvent( NULL, TRUE, TRUE, 0 ) ); //创建或打开一个命名的或无名的事件对象
  10. for( int i = 0; i < MAX_ADDR; i++ )
  11. {
  12. memset(m_szNxr_41Msg[i], 0, sizeof(m_szNxr_41Msg[i]));
  13. memset(m_szNxr_43Msg[i], 0, sizeof(m_szNxr_43Msg[i]));
  14. memset(m_szNxr_44Msg[i], 0, sizeof(m_szNxr_44Msg[i]));
  15. memset(m_szNxr_E1Msg[i], 0, sizeof(m_szNxr_E1Msg[i]));
  16. memset(m_szNxr_E2Msg[i], 0, sizeof(m_szNxr_E2Msg[i]));
  17. memset(m_szNxr_E3Msg[i], 0, sizeof(m_szNxr_E3Msg[i]));
  18. memset(m_szNxr_E7Msg[i], 0, sizeof(m_szNxr_E7Msg[i]));
  19. m_devOnline[i] = TRUE;
  20. m_dwOnlineTick[i] = 0;
  21. }
  22. }
  23. CUPSNxr::~CUPSNxr()
  24. {
  25. #if IS_USE_READMSG_CS
  26. DeleteCriticalSection( &m_csReadMsg );
  27. #endif
  28. MTVERIFY( CloseHandle( m_hSemComm ) );
  29. CloseComm();
  30. }
  31. BOOL CUPSNxr::NxrOpenComm(int nCommPort, int nAddr, int nRate, int nDataBit, int nStopBit, int nParity, int nInterval)
  32. {
  33. BOOL bResult = FALSE;
  34. bResult = OpenComm( nCommPort, nAddr, nRate, nDataBit, nStopBit, nParity, nInterval );
  35. //LOG4C((LOG_NOTICE," CUPSNxr::NxrOpenComm"));
  36. return bResult;
  37. }
  38. int CUPSNxr::SendReadRequest(
  39. char *szPath,
  40. char *szIniName,
  41. int nCommPort,
  42. int nAddr,
  43. char *szCmd,
  44. char *szMsg,
  45. int nReversed1,
  46. int nReversed2,
  47. int nReversed3,
  48. int nReversed4,
  49. int nReversed5,
  50. float fReversed1,
  51. float fReversed2,
  52. float fReversed3,
  53. char *szReversed1,
  54. char *szReversed2,
  55. char *szReversed3,
  56. char *szReversed4,
  57. char *szReversed5 )
  58. {
  59. CCommProcess *pComm = FindComm(nCommPort);
  60. if( pComm == NULL ) return -1;
  61. int nRet = -1;
  62. int nIndex(0), nLen(0), IniSendlen(0),iSBit(0), iEBit(0);
  63. char IniSendCMD[MAX_CMD] = {0}, szDataType[CMD_TYPE] = {0};
  64. GetIniInfo(szPath,szIniName,szCmd,IniSendCMD,IniSendlen,szDataType,nIndex,nLen,iSBit,iEBit);
  65. int iCmd = atoi(szCmd + 4);
  66. if( (strlen(m_szNxr_41Msg[nAddr - 1]) == 0 && (iCmd >= 1 && iCmd <=15)) || iCmd == 1 || //获取系统模拟量量化数据(浮点数)
  67. ( strlen(m_szNxr_43Msg[nAddr - 1]) == 0 && (iCmd >= 16 && iCmd <=40)) || iCmd == 16 || //获取开关输入状态
  68. ( strlen(m_szNxr_44Msg[nAddr - 1]) == 0 && (iCmd >= 41 && iCmd <=127)) || iCmd == 41 || //报警量
  69. (strlen(m_szNxr_E1Msg[nAddr - 1]) == 0 && (iCmd >= 128 && iCmd <=143)) || iCmd == 130 || //E1获取自定义模拟量量化数据1(浮点数,厂家扩展模拟量1)
  70. (strlen(m_szNxr_E2Msg[nAddr - 1]) == 0 && (iCmd >= 144 && iCmd <=163)) || iCmd == 146 || //获取自定义模拟量量化数据2(浮点数,厂家扩展模拟量2)
  71. (strlen(m_szNxr_E3Msg[nAddr - 1]) == 0 && (iCmd >= 164 && iCmd <=173)) || iCmd == 164 || //获取自定义模拟量量化数据3(浮点数,厂家扩展模拟量3)
  72. (strlen(m_szNxr_E7Msg[nAddr - 1]) == 0 && (iCmd >= 174 && iCmd <=183)) || iCmd == 176 //获取自定义模拟量量化数据4(浮点数,厂家扩展模拟量4)
  73. )
  74. {
  75. nRet = GetDeviceParam( nAddr,pComm,szCmd,IniSendCMD,IniSendlen );
  76. if( nRet != 0 ) return nRet;
  77. }
  78. if( GetTickCount() - m_dwOnlineTick[nAddr - 1] > 60 *1000 && m_dwOnlineTick[nAddr - 1] > 0 )
  79. m_devOnline[nAddr - 1] = FALSE;
  80. else if( GetTickCount() - m_dwOnlineTick[nAddr - 1] < 60 *1000 && m_dwOnlineTick[nAddr - 1] > 0 )
  81. m_devOnline[nAddr - 1] = TRUE;
  82. if( m_devOnline[nAddr - 1] == FALSE )
  83. return -1;
  84. nRet = GetNxr_41VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
  85. nRet = GetNxr_43VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
  86. nRet = GetNxr_44VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
  87. nRet = GetNxr_E1VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
  88. nRet = GetNxr_E2VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
  89. nRet = GetNxr_E3VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
  90. nRet = GetNxr_E7VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
  91. // if (iCmd == 43)
  92. // LOG4C((LOG_NOTICE, "%s = %s", szCmd, szMsg));
  93. return nRet;
  94. }
  95. int CUPSNxr::GetDeviceParam(int nAddr,CCommProcess *pComm,char *szCmd,char *IniSendCMD, const int &IniSendlen)
  96. {
  97. int nRet = -1;
  98. nRet = Send_ReadDeviceData(nAddr,pComm,szCmd,IniSendCMD,IniSendlen);
  99. if( nRet != 0 )
  100. {
  101. LOG4C((LOG_NOTICE,"RequestStatus::Error"));
  102. return nRet;
  103. }
  104. nRet = Recv_ReadDeviceData(nAddr,pComm,szCmd);
  105. return nRet;
  106. }
  107. int CUPSNxr::Send_ReadDeviceData(int nAddr,CCommProcess *pComm,char *szCmd, const char *IniSendCMD,const int &IniSendlen)
  108. {
  109. int nRet = -1;
  110. #if DEBUG_NXR
  111. char chLength[4] = {0};
  112. char chChkSum[5] = {0};
  113. if ((strcmp(IniSendCMD, "43") == 0) || (strcmp(IniSendCMD, "44") == 0) || (strcmp(IniSendCMD, "E3") == 0))
  114. {
  115. int iLen = sizeof(REQUESTNOCOMMD);
  116. REQUESTNOCOMMD RequestPara;
  117. memset( &RequestPara, 0, iLen );
  118. //起始位
  119. RequestPara.Start = 0x7E;
  120. //通讯协议版本
  121. RequestPara.Version[0] = 0x31;
  122. RequestPara.Version[1] = 0x30;
  123. //RequestPara.Version[1] = 0x32;
  124. //设备地址描述
  125. RequestPara.Address[0] = ByteToAscii((nAddr>>4) & 0x0f);
  126. RequestPara.Address[1] = ByteToAscii(nAddr & 0x0f);
  127. //Cid1
  128. RequestPara.Cid1[0] = 0x32;
  129. RequestPara.Cid1[1] = 0x41;
  130. //Cid2
  131. memcpy(RequestPara.Cid2, IniSendCMD, 2);
  132. RequestPara.Lenth[1] = 0x30;
  133. RequestPara.Lenth[2] = 0x30;
  134. RequestPara.Lenth[3] = 0x30;
  135. RequestPara.Lenth[0] = ByteToAscii(GetLengthSum(RequestPara.Lenth));
  136. BYTE *pDataBuf = new BYTE[ iLen - sizeof(RequestPara.chkSum) - 1 ];
  137. memset(pDataBuf, 0, iLen - sizeof(RequestPara.chkSum) - 1 );
  138. memcpy(pDataBuf, &RequestPara, iLen - sizeof(RequestPara.chkSum) - 1 );
  139. GetCheckSum((char *)pDataBuf + 1, chChkSum, iLen - sizeof(RequestPara.chkSum) - 2 );
  140. RequestPara.chkSum[0] = chChkSum[0];
  141. RequestPara.chkSum[1] = chChkSum[1];
  142. RequestPara.chkSum[2] = chChkSum[2];
  143. RequestPara.chkSum[3] = chChkSum[3];
  144. //结束符
  145. RequestPara.End = 0x0D;
  146. if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) // 有信号才写串口
  147. {
  148. int nDataLen = (int)sizeof(RequestPara);
  149. ResetEvent( m_hSemComm );
  150. int nResult = pComm->Write((BYTE *)&RequestPara, nDataLen);
  151. if( nResult == nDataLen )
  152. {
  153. }
  154. else
  155. {
  156. delete []pDataBuf;
  157. SetEvent( m_hSemComm );
  158. return EER_CODE_NXR_COM_WRITE_DATA;
  159. }
  160. }
  161. else
  162. {
  163. //LOG4C((LOG_NOTICE, "m_hSemComm no single"));
  164. delete []pDataBuf;
  165. return ERR_CODE_NXR_COM_BUSY;
  166. }
  167. delete[]pDataBuf;
  168. }
  169. else if ((strcmp(IniSendCMD, "41") == 0) || (strcmp(IniSendCMD, "E1") == 0) || (strcmp(IniSendCMD, "E2") == 0) )
  170. {
  171. int iLen = sizeof(REQUESTTWOCOMMD);
  172. REQUESTTWOCOMMD RequestPara;
  173. memset( &RequestPara, 0, iLen );
  174. //起始位
  175. RequestPara.Start = 0x7E;
  176. //通讯协议版本
  177. RequestPara.Version[0] = 0x31;
  178. RequestPara.Version[1] = 0x30;
  179. //设备地址描述
  180. RequestPara.Address[0] = ByteToAscii((nAddr>>4) & 0x0f);
  181. RequestPara.Address[1] = ByteToAscii(nAddr & 0x0f);
  182. //Cid1
  183. RequestPara.Cid1[0] = 0x32;
  184. RequestPara.Cid1[1] = 0x41;
  185. //Cid2
  186. memcpy(RequestPara.Cid2, IniSendCMD, 2);
  187. RequestPara.Lenth[1] = 0x30;
  188. RequestPara.Lenth[2] = 0x30;
  189. RequestPara.Lenth[3] = 0x32;
  190. RequestPara.Lenth[0] = ByteToAscii(GetLengthSum(RequestPara.Lenth));
  191. RequestPara.GroupInfo[0] = 0x30;
  192. RequestPara.GroupInfo[1] = 0x30;
  193. BYTE *pDataBuf = new BYTE[ iLen - sizeof(RequestPara.chkSum) - 1 ];
  194. memset(pDataBuf, 0, iLen - sizeof(RequestPara.chkSum) - 1 );
  195. memcpy(pDataBuf, &RequestPara, iLen - sizeof(RequestPara.chkSum) - 1 );
  196. GetCheckSum((char *)pDataBuf + 1, chChkSum, iLen - sizeof(RequestPara.chkSum) - 2 );
  197. RequestPara.chkSum[0] = chChkSum[0];
  198. RequestPara.chkSum[1] = chChkSum[1];
  199. RequestPara.chkSum[2] = chChkSum[2];
  200. RequestPara.chkSum[3] = chChkSum[3];
  201. //结束符
  202. RequestPara.End = 0x0D;
  203. //LOG4C_HEX_DUMP((LOG_NOTICE, (char *)&RequestPara, sizeof(RequestPara)));
  204. if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) // 有信号才写串口
  205. {
  206. int nDataLen = (int)sizeof(RequestPara);
  207. ResetEvent( m_hSemComm );
  208. int nResult = pComm->Write((BYTE *)&RequestPara, nDataLen);
  209. if( nResult == nDataLen )
  210. {
  211. }
  212. else
  213. {
  214. delete []pDataBuf;
  215. SetEvent( m_hSemComm );
  216. return EER_CODE_NXR_COM_WRITE_DATA;
  217. }
  218. }
  219. else
  220. {
  221. //LOG4C((LOG_NOTICE, "m_hSemComm no single"));
  222. delete []pDataBuf;
  223. return ERR_CODE_NXR_COM_BUSY;
  224. }
  225. delete[]pDataBuf;
  226. }
  227. else if (strcmp(IniSendCMD, "E7") == 0)
  228. {
  229. int iLen = sizeof(REQUESTFOURCOMMD);
  230. REQUESTFOURCOMMD RequestPara;
  231. memset( &RequestPara, 0, iLen );
  232. //起始位
  233. RequestPara.Start = 0x7E;
  234. //通讯协议版本
  235. RequestPara.Version[0] = 0x31;
  236. RequestPara.Version[1] = 0x30;
  237. //设备地址描述
  238. RequestPara.Address[0] = ByteToAscii((nAddr>>4) & 0x0f);
  239. RequestPara.Address[1] = ByteToAscii(nAddr & 0x0f);
  240. //Cid1
  241. RequestPara.Cid1[0] = 0x32;
  242. RequestPara.Cid1[1] = 0x41;
  243. //Cid2
  244. memcpy(RequestPara.Cid2, IniSendCMD, 2);
  245. RequestPara.Lenth[1] = 0x30;
  246. RequestPara.Lenth[2] = 0x30;
  247. RequestPara.Lenth[3] = 0x34;
  248. RequestPara.Lenth[0] = ByteToAscii(GetLengthSum(RequestPara.Lenth));
  249. RequestPara.GroupInfo[0] = 0x30;
  250. RequestPara.GroupInfo[1] = 0x31;
  251. RequestPara.GroupInfo[2] = 0x30;
  252. RequestPara.GroupInfo[3] = 0x30;
  253. BYTE *pDataBuf = new BYTE[ iLen - sizeof(RequestPara.chkSum) - 1 ];
  254. memset(pDataBuf, 0, iLen - sizeof(RequestPara.chkSum) - 1 );
  255. memcpy(pDataBuf, &RequestPara, iLen - sizeof(RequestPara.chkSum) - 1 );
  256. GetCheckSum((char *)pDataBuf + 1, chChkSum, iLen - sizeof(RequestPara.chkSum) - 2 );
  257. RequestPara.chkSum[0] = chChkSum[0];
  258. RequestPara.chkSum[1] = chChkSum[1];
  259. RequestPara.chkSum[2] = chChkSum[2];
  260. RequestPara.chkSum[3] = chChkSum[3];
  261. //结束符
  262. RequestPara.End = 0x0D;
  263. //LOG4C_HEX_DUMP((LOG_NOTICE, (char *)&RequestPara, sizeof(RequestPara)));
  264. if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) // 有信号才写串口
  265. {
  266. int nDataLen = (int)sizeof(RequestPara);
  267. ResetEvent( m_hSemComm );
  268. int nResult = pComm->Write((BYTE *)&RequestPara, nDataLen);
  269. if( nResult == nDataLen )
  270. {
  271. }
  272. else
  273. {
  274. delete []pDataBuf;
  275. SetEvent( m_hSemComm );
  276. return EER_CODE_NXR_COM_WRITE_DATA;
  277. }
  278. }
  279. else
  280. {
  281. //LOG4C((LOG_NOTICE, "m_hSemComm no single"));
  282. delete []pDataBuf;
  283. return ERR_CODE_NXR_COM_BUSY;
  284. }
  285. delete[]pDataBuf;
  286. }
  287. #endif
  288. return 0;
  289. }
  290. int CUPSNxr::Recv_ReadDeviceData(int nAddr,CCommProcess *pComm,char *szCmd)
  291. {
  292. #if DEBUG_NXR
  293. int nReceiveLen = 0;
  294. int nProcessLen = 0;
  295. int nReadLen = 0;
  296. RESPONSE_STRUCT structResponse;
  297. memset( &structResponse, 0, sizeof(RESPONSE_STRUCT) );
  298. nReceiveLen = sizeof(RESPONSE_STRUCT);
  299. char *pBuffer = new char[ nReceiveLen ];
  300. memset(pBuffer, 0, nReceiveLen);
  301. nReadLen = pComm->Read((BYTE *)pBuffer,nReceiveLen);
  302. //if ( strcmp(szCmd, "cmd-41") == 0)
  303. //{
  304. // LOG4C((LOG_NOTICE,"UPS-Nxr : %s",pBuffer));
  305. //}
  306. if( nReadLen <= 0)
  307. {
  308. SetEvent( m_hSemComm );
  309. if( pBuffer != NULL)
  310. {
  311. delete[] pBuffer;
  312. pBuffer = NULL;
  313. }
  314. return ERR_CODE_NXR_COM_READ_NO_DATA;
  315. }
  316. if (LengthCheck(pBuffer) != 0)
  317. {
  318. SetEvent(m_hSemComm);
  319. if (pBuffer != NULL)
  320. {
  321. delete [] pBuffer;
  322. pBuffer = NULL;
  323. }
  324. return ERR_CODE_RTN_LCHKSUM_ERROR;
  325. }
  326. if (!ChkSumCheck(pBuffer, nReadLen))
  327. {
  328. SetEvent(m_hSemComm);
  329. if (pBuffer != NULL)
  330. {
  331. delete [] pBuffer;
  332. pBuffer = NULL;
  333. }
  334. return ERR_CODE_RTN_CHKSUM_ERROR; //校验码校验出错
  335. }
  336. if (RtnCheck(pBuffer) != 0)
  337. {
  338. SetEvent(m_hSemComm);
  339. if (pBuffer != NULL)
  340. {
  341. delete [] pBuffer;
  342. pBuffer = NULL;
  343. }
  344. return ERR_CODE_RTN_CHKSUM_RTN_ERROR; //RTN校验出错
  345. }
  346. SetNxr_41VarMsg(nAddr, szCmd, pBuffer);
  347. SetNxr_43VarMsg(nAddr, szCmd, pBuffer);
  348. SetNxr_44VarMsg(nAddr, szCmd, pBuffer);
  349. SetNxr_E1VarMsg(nAddr, szCmd, pBuffer);
  350. SetNxr_E2VarMsg(nAddr, szCmd, pBuffer);
  351. SetNxr_E3VarMsg(nAddr, szCmd, pBuffer);
  352. SetNxr_E7VarMsg(nAddr, szCmd, pBuffer);
  353. m_dwOnlineTick[nAddr - 1] = GetTickCount();
  354. // 设置串口等待事件为有信号
  355. SetEvent( m_hSemComm );
  356. if( pBuffer != NULL)
  357. {
  358. delete[] pBuffer;
  359. pBuffer = NULL;
  360. }
  361. #else
  362. SimulationCommData(nAddr);
  363. #endif
  364. return 0;
  365. }
  366. int CUPSNxr::GetNxr_41VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
  367. {
  368. int nRet = 0;
  369. int iCmd = atoi(szCmd + 4);
  370. if( iCmd >= 1 && iCmd <= 15)
  371. {
  372. #if IS_USE_READMSG_CS
  373. EnterCriticalSection( &m_csReadMsg );
  374. #endif
  375. DataConversion(szType, m_szNxr_41Msg[nAddr - 1] + nIndex, szMsg, nLen, iSBit, iEBit);
  376. #if IS_USE_READMSG_CS
  377. LeaveCriticalSection(&m_csReadMsg);
  378. #endif
  379. nRet = 0;
  380. }
  381. return nRet;
  382. }
  383. int CUPSNxr::GetNxr_43VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
  384. {
  385. int nRet = 0;
  386. int iCmd = atoi(szCmd + 4);
  387. if( iCmd >= 16 && iCmd <= 40)
  388. {
  389. #if IS_USE_READMSG_CS
  390. EnterCriticalSection( &m_csReadMsg );
  391. #endif
  392. DataConversion(szType, m_szNxr_43Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
  393. #if IS_USE_READMSG_CS
  394. LeaveCriticalSection(&m_csReadMsg);
  395. #endif
  396. nRet = 0;
  397. }
  398. return nRet;
  399. }
  400. int CUPSNxr::GetNxr_44VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
  401. {
  402. int nRet = 0;
  403. int iCmd = atoi(szCmd + 4);
  404. if( iCmd >= 41 && iCmd <= 127)
  405. {
  406. #if IS_USE_READMSG_CS
  407. EnterCriticalSection( &m_csReadMsg );
  408. #endif
  409. DataConversion(szType, m_szNxr_44Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
  410. #if IS_USE_READMSG_CS
  411. LeaveCriticalSection(&m_csReadMsg);
  412. #endif
  413. nRet = 0;
  414. }
  415. return nRet;
  416. }
  417. int CUPSNxr::GetNxr_E1VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
  418. {
  419. int nRet = 0;
  420. int iCmd = atoi(szCmd + 4);
  421. if( iCmd >= 128 && iCmd <= 143)
  422. {
  423. #if IS_USE_READMSG_CS
  424. EnterCriticalSection( &m_csReadMsg );
  425. #endif
  426. DataConversion(szType, m_szNxr_E1Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
  427. #if IS_USE_READMSG_CS
  428. LeaveCriticalSection(&m_csReadMsg);
  429. #endif
  430. nRet = 0;
  431. }
  432. return nRet;
  433. }
  434. int CUPSNxr::GetNxr_E2VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
  435. {
  436. int nRet = 0;
  437. int iCmd = atoi(szCmd + 4);
  438. if( iCmd >= 144 && iCmd <= 163)
  439. {
  440. #if IS_USE_READMSG_CS
  441. EnterCriticalSection( &m_csReadMsg );
  442. #endif
  443. DataConversion(szType, m_szNxr_E2Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
  444. #if IS_USE_READMSG_CS
  445. LeaveCriticalSection(&m_csReadMsg);
  446. #endif
  447. nRet = 0;
  448. }
  449. return nRet;
  450. }
  451. int CUPSNxr::GetNxr_E3VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
  452. {
  453. int nRet = 0;
  454. int iCmd = atoi(szCmd + 4);
  455. if( iCmd >= 164 && iCmd <= 173)
  456. {
  457. #if IS_USE_READMSG_CS
  458. EnterCriticalSection( &m_csReadMsg );
  459. #endif
  460. DataConversion(szType, m_szNxr_E3Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
  461. #if IS_USE_READMSG_CS
  462. LeaveCriticalSection(&m_csReadMsg);
  463. #endif
  464. nRet = 0;
  465. }
  466. return nRet;
  467. }
  468. int CUPSNxr::GetNxr_E7VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
  469. {
  470. int nRet = 0;
  471. int iCmd = atoi(szCmd + 4);
  472. if( iCmd >= 174 && iCmd <= 183)
  473. {
  474. #if IS_USE_READMSG_CS
  475. EnterCriticalSection( &m_csReadMsg );
  476. #endif
  477. DataConversion(szType, m_szNxr_E7Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
  478. #if IS_USE_READMSG_CS
  479. LeaveCriticalSection(&m_csReadMsg);
  480. #endif
  481. nRet = 0;
  482. }
  483. return nRet;
  484. }
  485. void CUPSNxr::SetNxr_41VarMsg( int nAddr, char *szCmd, char *pBuffer)
  486. {
  487. int iCmd = atoi(szCmd + 4);
  488. if( iCmd >= 1 && iCmd <= 15)
  489. {
  490. #if IS_USE_READMSG_CS
  491. EnterCriticalSection( &m_csReadMsg );
  492. #endif
  493. memcpy(m_szNxr_41Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_41Msg[nAddr - 1]));
  494. #if IS_USE_READMSG_CS
  495. LeaveCriticalSection(&m_csReadMsg);
  496. #endif
  497. }
  498. }
  499. void CUPSNxr::SetNxr_43VarMsg( int nAddr, char *szCmd, char *pBuffer)
  500. {
  501. int iCmd = atoi(szCmd + 4);
  502. if( iCmd >= 16 && iCmd <= 40)
  503. {
  504. #if IS_USE_READMSG_CS
  505. EnterCriticalSection( &m_csReadMsg );
  506. #endif
  507. memcpy(m_szNxr_43Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_43Msg[nAddr - 1]));
  508. #if IS_USE_READMSG_CS
  509. LeaveCriticalSection(&m_csReadMsg);
  510. #endif
  511. }
  512. }
  513. void CUPSNxr::SetNxr_44VarMsg( int nAddr, char *szCmd, char *pBuffer)
  514. {
  515. int iCmd = atoi(szCmd + 4);
  516. if( iCmd >= 41 && iCmd <= 127)
  517. {
  518. #if IS_USE_READMSG_CS
  519. EnterCriticalSection( &m_csReadMsg );
  520. #endif
  521. //memcpy(m_szNxr_44Msg[nAddr - 1], pBuffer + 10, sizeof(m_szNxr_44Msg[nAddr - 1])); //Z.t国贸时的UPS处理;
  522. memcpy(m_szNxr_44Msg[nAddr - 1], pBuffer , sizeof(m_szNxr_44Msg[nAddr - 1])); //Z.t思明公安局有时的UPS处理;
  523. #if IS_USE_READMSG_CS
  524. LeaveCriticalSection(&m_csReadMsg);
  525. #endif
  526. }
  527. }
  528. void CUPSNxr::SetNxr_E1VarMsg( int nAddr, char *szCmd, char *pBuffer)
  529. {
  530. int iCmd = atoi(szCmd + 4);
  531. if( iCmd >= 128 && iCmd <= 143)
  532. {
  533. #if IS_USE_READMSG_CS
  534. EnterCriticalSection( &m_csReadMsg );
  535. #endif
  536. memcpy(m_szNxr_E1Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E1Msg[nAddr - 1]));
  537. #if IS_USE_READMSG_CS
  538. LeaveCriticalSection(&m_csReadMsg);
  539. #endif
  540. }
  541. }
  542. void CUPSNxr::SetNxr_E2VarMsg( int nAddr, char *szCmd, char *pBuffer)
  543. {
  544. int iCmd = atoi(szCmd + 4);
  545. if( iCmd >= 144 && iCmd <= 163)
  546. {
  547. #if IS_USE_READMSG_CS
  548. EnterCriticalSection( &m_csReadMsg );
  549. #endif
  550. memcpy(m_szNxr_E2Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E2Msg[nAddr - 1]));
  551. #if IS_USE_READMSG_CS
  552. LeaveCriticalSection(&m_csReadMsg);
  553. #endif
  554. }
  555. }
  556. void CUPSNxr::SetNxr_E3VarMsg( int nAddr, char *szCmd, char *pBuffer)
  557. {
  558. int iCmd = atoi(szCmd + 4);
  559. if( iCmd >= 164 && iCmd <= 173)
  560. {
  561. #if IS_USE_READMSG_CS
  562. EnterCriticalSection( &m_csReadMsg );
  563. #endif
  564. memcpy(m_szNxr_E3Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E3Msg[nAddr - 1]));
  565. #if IS_USE_READMSG_CS
  566. LeaveCriticalSection(&m_csReadMsg);
  567. #endif
  568. }
  569. }
  570. void CUPSNxr::SetNxr_E7VarMsg( int nAddr, char *szCmd, char *pBuffer)
  571. {
  572. int iCmd = atoi(szCmd + 4);
  573. if( iCmd >= 174 && iCmd <= 183)
  574. {
  575. #if IS_USE_READMSG_CS
  576. EnterCriticalSection( &m_csReadMsg );
  577. #endif
  578. memcpy(m_szNxr_E7Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E7Msg[nAddr - 1]));
  579. #if IS_USE_READMSG_CS
  580. LeaveCriticalSection(&m_csReadMsg);
  581. #endif
  582. }
  583. }
  584. WORD CUPSNxr::RtnCheck(char Msg[VAR_MSG])
  585. {
  586. char buffer[3] = {0};
  587. int j = 0;
  588. for (int i = 7; i < 9; i++)
  589. {
  590. buffer[j++] = Msg[i];
  591. }
  592. buffer[j] = '\0';
  593. if (strcmp(buffer,"00") == 0)
  594. {
  595. return 0;
  596. }
  597. else if (strcmp(buffer,"01") == 0)
  598. {
  599. return ERR_CODE_RTN_VER_ERROR;
  600. }
  601. else if (strcmp(buffer,"02") == 0)
  602. {
  603. return ERR_CODE_RTN_CHKSUM_ERROR;
  604. }
  605. else if (strcmp(buffer,"03") == 0)
  606. {
  607. return ERR_CODE_RTN_LCHKSUM_ERROR;
  608. }
  609. else if (strcmp(buffer,"04") == 0)
  610. {
  611. return ERR_CODE_RTN_CID_ERROR;
  612. }
  613. else if (strcmp(buffer,"05") == 0)
  614. {
  615. return ERR_CODE_RTN_COMMAND_FORMAT;
  616. }
  617. else if (strcmp(buffer,"06") == 0)
  618. {
  619. return ERR_CODE_RTN_INVALID_LIMIT;
  620. }
  621. else if (strcmp(buffer,"10") == 0)
  622. {
  623. return ERR_CODE_RTN_OPERATE_FAIL;
  624. }
  625. return 0;
  626. }
  627. UINT CUPSNxr::GetCheckSum(char *pBuf, char chDest[5], int len)
  628. {
  629. WORD iSum = 0;
  630. for(int i=0; i<len; i++)//求和
  631. {
  632. iSum += pBuf[i];
  633. }
  634. WORD iCompliment = iSum;
  635. iCompliment = ~iCompliment;//取反
  636. iCompliment++;
  637. itoa(iCompliment, chDest, 16);
  638. chDest[0] = lowercase2uppercase(chDest[0]);
  639. chDest[1] = lowercase2uppercase(chDest[1]);
  640. chDest[2] = lowercase2uppercase(chDest[2]);
  641. chDest[3] = lowercase2uppercase(chDest[3]);
  642. return atoi(chDest);
  643. }
  644. BYTE CUPSNxr::GetLengthSum(BYTE szChar[])
  645. {
  646. unsigned int nData = 0;
  647. unsigned int nData1 =0;
  648. unsigned short nDataLength = 0;
  649. unsigned short nChar1;
  650. nChar1 =AsciiToBYTE(szChar[1]) +
  651. AsciiToBYTE(szChar[2]) +
  652. AsciiToBYTE(szChar[3]);
  653. nChar1 = (~nChar1) + 1;
  654. nChar1 %=16;
  655. return (BYTE)nChar1;
  656. }
  657. int CUPSNxr::LengthCheck(char szSendMsg[])
  658. {
  659. int len = (int)strlen(szSendMsg);
  660. char buffer[5] = {0};
  661. int j = 0;
  662. for (int i = 9; i< 13; i++)
  663. {
  664. buffer[j++] = szSendMsg[i]; //取出检验位
  665. }
  666. buffer[j] ='0';
  667. if(!ValiateLength(buffer)) // 相加模十六取反加一
  668. {
  669. return ERR_CODE_RTN_LCHKSUM_ERROR;
  670. }
  671. /*转换为十六进制*/
  672. return 0;
  673. }
  674. BOOL CUPSNxr::ValiateLength(char szChar[])
  675. {
  676. unsigned int nData = 0;
  677. unsigned int nData1 =0;
  678. unsigned short nDataLength = 0;
  679. unsigned short nChar1;
  680. nChar1 =AsciiToBYTE(szChar[1]) +
  681. AsciiToBYTE(szChar[2]) +
  682. AsciiToBYTE(szChar[3]);
  683. nChar1 = (~nChar1) + 1;
  684. nChar1 %=16;
  685. nDataLength = AsciiToBYTE(szChar[0]);
  686. if (nDataLength != nChar1)
  687. {
  688. return FALSE;
  689. }
  690. return TRUE;
  691. }
  692. void CUPSNxr::SimulationCommData(int nAddr)
  693. {
  694. //LOG4C((LOG_NOTICE,"模拟"));
  695. //memcpy(m_szNxr_41Msg[nAddr - 1], "~10012A00006A0004CD4C5E439A1960439A995E439A995C4333B35B439A195B430000C03F6666663F0000C03F9A190744C3F547420000009A190744E6D0.",130);
  696. //memcpy(m_szNxr_43Msg[nAddr - 1], "~10012A009034000117E0E1E2E3E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0F0DF.",70);
  697. }
  698. /*
  699. Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
  700. Length: 0124, Data: 7E 31 30 30 31 32 41 30 30 30 30 36 41 30 31 30 30 39 41 39 39 36 30 34 33 33 33 42 33 36 30 34 33 36 36 45 36 35 46 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 30 30 30 30 35 30 34 31 30 30 30 30 34 30 34 31 30 30 30 30 34 38 34 31 30 30 38 30 30 36 34 34 43 44 43 43 34 37 34 32 30 30 30 30 30 30 30 30 38 30 30 36 34 34 45 37 44 37 0D
  701. Length: 0018, Data: 7E 31 30 30 31 32 41 34 33 30 30 30 30 46 44 41 34 0D
  702. Length: 0070, Data: 7E 31 30 30 31 32 41 30 30 39 30 33 34 30 31 30 31 31 37 45 31 45 30 45 31 45 30 45 31 45 31 45 30 45 31 45 31 45 30 45 32 45 31 45 32 45 30 45 30 45 30 45 30 45 30 45 31 45 31 45 31 45 31 45 31 46 31 44 45 0D
  703. Length: 0018, Data: 7E 31 30 30 31 32 41 34 34 30 30 30 30 46 44 41 33 0D
  704. Length: 0204, Data: 7E 31 30 30 31 32 41 30 30 42 30 42 41 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 35 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 44 41 38 43 0D
  705. Length: 0020, Data: 7E 31 30 30 31 32 41 45 31 45 30 30 32 30 30 46 44 31 45 0D
  706. Length: 0136, Data: 7E 31 30 30 31 32 41 30 30 33 30 37 36 30 31 30 30 30 45 39 41 39 39 43 32 34 33 33 33 33 33 43 32 34 33 33 33 33 33 43 32 34 33 36 36 36 36 32 36 34 31 39 41 39 39 30 39 34 31 36 36 36 36 30 45 34 31 34 38 45 31 34 37 34 32 38 35 45 42 35 31 33 46 42 38 31 45 34 35 33 46 31 34 41 45 34 37 33 46 43 44 43 43 35 46 34 33 39 41 39 39 35 46 34 33 39 41 31 39 35 45 34 33 43 44 43 43 34 37 34 32 45 33 42 35 0D
  707. Length: 0020, Data: 7E 31 30 30 31 32 41 45 32 45 30 30 32 30 30 46 44 31 44 0D
  708. Length: 0168, Data: 7E 31 30 30 31 32 41 30 30 31 30 39 36 30 31 30 30 31 32 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 30 30 30 30 30 30 34 30 33 33 33 33 46 33 33 46 33 33 33 33 46 33 33 46 33 33 33 33 33 33 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 33 33 33 33 33 33 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 39 41 39 39 42 39 34 30 36 36 36 36 41 36 34 30 39 41 39 39 41 39 34 30 44 45 41 37 0D
  709. Length: 0018, Data: 7E 31 30 30 31 32 41 45 33 30 30 30 30 46 44 39 33 0D
  710. Length: 0094, Data: 7E 31 30 30 31 32 41 30 30 30 30 34 43 30 31 30 39 43 44 43 43 41 43 34 30 43 44 43 43 39 43 34 30 36 36 36 36 42 36 34 30 33 33 33 33 42 33 34 30 30 30 30 30 41 30 34 30 43 44 43 43 42 43 34 30 33 33 33 33 42 33 33 46 36 36 36 36 36 36 33 46 30 30 30 30 43 30 33 46 45 43 45 31 0D
  711. Length: 0022, Data: 7E 31 30 30 31 32 41 45 37 43 30 30 34 30 31 30 30 46 43 42 37 0D
  712. Length: 0088, Data: 7E 31 30 30 31 32 41 30 30 36 30 34 36 30 31 30 31 30 38 30 30 30 30 46 37 34 33 33 33 33 33 38 37 34 33 30 30 30 30 30 30 33 46 33 33 42 33 38 35 34 33 41 45 34 37 45 31 33 45 37 36 44 32 37 37 33 46 30 30 30 30 43 38 34 31 30 30 30 30 43 38 34 31 45 45 46 41 0D
  713. Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
  714. Length: 0124, Data: 7E 31 30 30 31 32 41 30 30 30 30 36 41 30 31 30 30 36 36 45 36 35 46 34 33 36 36 36 36 35 46 34 33 33 33 42 33 35 45 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 30 30 30 30 35 30 34 31 30 30 30 30 33 38 34 31 30 30 30 30 34 38 34 31 36 36 41 36 30 36 34 34 34 38 45 31 34 37 34 32 30 30 30 30 30 30 36 36 41 36 30 36 34 34 45 37 42 30 0D
  715. Length: 0018, Data: 7E 31 30 30 31 32 41 34 33 30 30 30 30 46 44 41 34 0D
  716. Length: 0070, Data: 7E 31 30 30 31 32 41 30 30 39 30 33 34 30 31 30 31 31 37 45 31 45 30 45 31 45 30 45 31 45 31 45 30 45 31 45 31 45 30 45 32 45 31 45 32 45 30 45 30 45 30 45 30 45 30 45 31 45 31 45 31 45 31 45 31 46 31 44 45 0D
  717. Length: 0018, Data: 7E 31 30 30 31 32 41 34 34 30 30 30 30 46 44 41 33 0D
  718. Length: 0204, Data: 7E 31 30 30 31 32 41 30 30 42 30 42 41 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 35 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 44 41 38 43 0D
  719. Length: 0020, Data: 7E 31 30 30 31 32 41 45 31 45 30 30 32 30 30 46 44 31 45 0D
  720. Length: 0136, Data: 7E 31 30 30 31 32 41 30 30 33 30 37 36 30 31 30 30 30 45 33 33 33 33 43 32 34 33 33 33 42 33 43 31 34 33 36 36 36 36 43 31 34 33 39 41 39 39 32 31 34 31 43 44 43 43 30 34 34 31 43 44 43 43 30 43 34 31 33 44 30 41 34 38 34 32 31 34 41 45 34 37 33 46 45 43 35 31 33 38 33 46 35 43 38 46 34 32 33 46 36 36 36 36 35 46 34 33 30 30 30 30 35 46 34 33 30 30 38 30 35 44 34 33 43 33 46 35 34 37 34 32 45 33 45 46 0D
  721. Length: 0020, Data: 7E 31 30 30 31 32 41 45 32 45 30 30 32 30 30 46 44 31 44 0D
  722. Length: 0168, Data: 7E 31 30 30 31 32 41 30 30 31 30 39 36 30 31 30 30 31 32 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 30 30 30 30 30 30 34 30 33 33 33 33 46 33 33 46 33 33 33 33 46 33 33 46 43 44 43 43 32 43 34 30 39 41 39 39 31 39 34 30 36 36 36 36 32 36 34 30 30 30 30 30 30 30 30 30 33 33 33 33 33 33 33 46 30 30 30 30 30 30 30 30 43 44 43 43 32 43 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 36 36 36 36 42 36 34 30 30 30 30 30 41 30 34 30 33 33 33 33 42 33 34 30 44 45 30 32 0D
  723. Length: 0018, Data: 7E 31 30 30 31 32 41 45 33 30 30 30 30 46 44 39 33 0D
  724. Length: 0094, Data: 7E 31 30 30 31 32 41 30 30 30 30 34 43 30 31 30 39 43 44 43 43 41 43 34 30 39 41 39 39 39 39 34 30 30 30 30 30 42 30 34 30 36 36 36 36 42 36 34 30 30 30 30 30 41 30 34 30 39 41 39 39 42 39 34 30 36 36 36 36 45 36 33 46 33 33 33 33 42 33 33 46 36 36 36 36 45 36 33 46 45 44 31 37 0D
  725. Length: 0022, Data: 7E 31 30 30 31 32 41 45 37 43 30 30 34 30 31 30 30 46 43 42 37 0D
  726. Length: 0088, Data: 7E 31 30 30 31 32 41 30 30 36 30 34 36 30 31 30 31 30 38 30 30 30 30 46 37 34 33 33 33 33 33 38 37 34 33 42 38 31 45 30 35 33 46 36 36 45 36 38 35 34 33 31 46 38 35 45 42 33 45 37 36 44 32 37 37 33 46 30 30 30 30 43 38 34 31 30 30 30 30 43 38 34 31 45 45 42 35 0D
  727. Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
  728. Length: 0124, Data: 7E 31 30 30 31 32 41 30 30 30 30 36 41 30 31 30 30 39 41 31 39 36 31 34 33 30 30 30 30 36 31 34 33 33 33 33 33 36 30 34 33 33 33 33 33 35 44 34 33 30 30 38 30 35 44 34 33 33 33 33 33 35 44 34 33 30 30 30 30 35 30 34 31 30 30 30 30 33 38 34 31 30 30 30 30 34 38 34 31 33 33 39 33 30 36 34 34 43 33 46 35 34 37 34 32 30 30 30 30 30 30 33 33 39 33 30 36 34 34 45 38 32 44 0D
  729. Length: 0018, Data: 7E 31 30 30 31 32 41 34 33 30 30 30 30 46 44 41 34 0D
  730. Length: 0070, Data: 7E 31 30 30 31 32 41 30 30 39 30 33 34 30 31 30 31 31 37 45 31 45 30 45 31 45 30 45 31 45 31 45 30 45 31 45 31 45 30 45 32 45 31 45 32 45 30 45 30 45 30 45 30 45 30 45 31 45 31 45 31 45 31 45 31 46 31 44 45 0D
  731. Length: 0018, Data: 7E 31 30 30 31 32 41 34 34 30 30 30 30 46 44 41 33 0D
  732. Length: 0204, Data: 7E 31 30 30 31 32 41 30 30 42 30 42 41 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 35 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 44 41 38 43 0D
  733. Length: 0020, Data: 7E 31 30 30 31 32 41 45 31 45 30 30 32 30 30 46 44 31 45 0D
  734. Length: 0136, Data: 7E 31 30 30 31 32 41 30 30 33 30 37 36 30 31 30 30 30 45 39 41 44 39 43 32 34 33 33 33 46 33 43 31 34 33 30 30 34 30 43 32 34 33 30 30 30 30 32 30 34 31 36 36 36 36 30 36 34 31 36 36 36 36 30 45 34 31 37 42 31 34 34 38 34 32 31 34 41 45 34 37 33 46 30 30 30 30 34 30 33 46 42 38 31 45 34 35 33 46 30 30 38 30 36 30 34 33 30 30 30 30 35 46 34 33 39 41 31 39 35 45 34 33 33 44 30 41 34 38 34 32 45 34 42 38 0D
  735. Length: 0020, Data: 7E 31 30 30 31 32 41 45 32 45 30 30 32 30 30 46 44 31 44 0D
  736. Length: 0168, Data: 7E 31 30 30 31 32 41 30 30 31 30 39 36 30 31 30 30 31 32 38 46 43 32 37 35 33 46 34 38 45 31 37 41 33 46 44 37 41 33 37 30 33 46 30 30 30 30 30 30 34 30 33 33 33 33 46 33 33 46 33 33 33 33 46 33 33 46 43 44 43 43 32 43 34 30 39 41 39 39 31 39 34 30 36 36 36 36 32 36 34 30 30 30 30 30 30 30 30 30 33 33 33 33 33 33 33 46 30 30 30 30 30 30 30 30 43 44 43 43 32 43 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 39 41 39 39 42 39 34 30 43 44 43 43 41 43 34 30 39 41 39 39 41 39 34 30 44 44 37 34 0D
  737. Length: 0018, Data: 7E 31 30 30 31 32 41 45 33 30 30 30 30 46 44 39 33 0D
  738. Length: 0094, Data: 7E 31 30 30 31 32 41 30 30 30 30 34 43 30 31 30 39 43 44 43 43 41 43 34 30 39 41 39 39 39 39 34 30 33 33 33 33 42 33 34 30 36 36 36 36 42 36 34 30 30 30 30 30 41 30 34 30 43 44 43 43 42 43 34 30 36 36 36 36 45 36 33 46 33 33 33 33 42 33 33 46 36 36 36 36 45 36 33 46 45 43 44 44 0D
  739. Length: 0022, Data: 7E 31 30 30 31 32 41 45 37 43 30 30 34 30 31 30 30 46 43 42 37 0D
  740. Length: 0088, Data: 7E 31 30 30 31 32 41 30 30 36 30 34 36 30 31 30 31 30 38 30 30 30 30 46 37 34 33 30 30 34 30 38 37 34 33 42 38 31 45 30 35 33 46 36 36 41 36 38 35 34 33 41 45 34 37 45 31 33 45 37 36 44 32 37 37 33 46 30 30 30 30 43 38 34 31 30 30 30 30 43 38 34 31 45 45 43 35 0D
  741. Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
  742. */