| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050 |
- #include "StdAfx.h"
- #include ".\pb9355.h"
- #include "StdAfx.h"
- #include "CommProcess.h"
- //#include ".\cms.h"
- CPB9355::CPB9355(
- char szPath[MAX_PATH], // 程序所在路径 ;
- char szIniName[MAX_PATH], // 配置文件名称;
- int nCommPort, // 串行端口;
- int nAddr, // 设备地址;
- int nRate, // 波特率 ;
- int nDataBit, // 数据位;
- int nStopBit, // 停止位;
- int nParity, // 校验位;
- int nInterval // 时间间隔;
- )
- {
- #if IS_USE_READMSG_CS
- InitializeCriticalSection( &m_csReadMsg ); //初始化一个临界资源对象;
- #endif
- MTVERIFY( m_hSemComm = CreateEvent( NULL, TRUE, TRUE, 0 ) ); //创建或打开一个命名的或无名的事件对象;
- memset(m_sz_33Msg, 0, sizeof(m_sz_33Msg));
- memset(m_sz_34Msg, 0, sizeof(m_sz_34Msg));
- memset(m_sz_35Msg, 0, sizeof(m_sz_35Msg));
- memset(m_szTemp, 0, sizeof(m_szTemp));
- memset(szProcessData, 0, sizeof(szProcessData));
- m_devOnline= TRUE;
- m_dwOnlineTick = 0;
- m_bRun = FALSE;
- }
- CPB9355::~CPB9355()
- {
- #if IS_USE_READMSG_CS
- DeleteCriticalSection( &m_csReadMsg );
- #endif
- MTVERIFY( CloseHandle( m_hSemComm ) );
- CloseComm();
- }
- BOOL CPB9355::PB9355OpenComm(int nCommPort, int nAddr, int nRate, int nDataBit, int nStopBit, int nParity, int nInterval)
- {
- BOOL bResult = FALSE;
- bResult = OpenComm( nCommPort, nAddr, nRate, nDataBit, nStopBit, nParity, nInterval );
- //LOG4C((LOG_NOTICE,"OpenComm Sucess"));
- return bResult;
- }
- int CPB9355::Authorization(CCommProcess *pComm)
- {
- int nRet = 0;
- /************************************************************************/
- /* SendMsg */
- /************************************************************************/
- BYTE SendPart[7] = {0};
- SendPart[0] = 0xAB;
- SendPart[1] = 0x04;
- SendPart[2] = 0xCF;
- SendPart[3] = 0x69;
- SendPart[4] = 0xE8;
- SendPart[5] = 0xD5;
- SendPart[6] = 0x5C;
- //WaitForSingObject();等待有信号;
- if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) {
- //ResetEvent()设置无信号状态
- ResetEvent( m_hSemComm );
- int nResult = pComm->Write(SendPart, 7);
- if( nResult != 7 ) {
- //SetEvent设置有信号;
- SetEvent( m_hSemComm );
- //返回 错误值;
- return EER_CODE_PB9355_COM_REGNUM;
- }
- }
- else{
- //如果m_hSemCom无信号,返回错误;
- return ERR_CODE_PB9355_COM_BUSY;
- }
- /************************************************************************/
- /* readfile ; */
- /************************************************************************/
- //int nRecvLen = 0;
- //BYTE pBuffer[270];
- //memset(pBuffer, 0, 270);
- //nRecvLen = pComm->Read(pBuffer,270);
- SetEvent( m_hSemComm );
- //LOG4C((LOG_NOTICE,"Authorization Sucess"));
- return 0;
- }
- int CPB9355::OnlyRequested(CCommProcess *pComm)
- {
- int nRet = 0;
- /************************************************************************/
- /* SendMsg */
- /************************************************************************/
- BYTE SendPart[4] = {0};
- SendPart[0] = 0xAB;
- SendPart[1] = 0x01;
- SendPart[2] = 0xA0;
- SendPart[3] = 0xB4;
- //WaitForSingObject();等待有信号;
- if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) {
- //ResetEvent()设置无信号状态
- ResetEvent( m_hSemComm );
- int nResult = pComm->Write(SendPart, 4);
- if( nResult != 4 ) {
- //SetEvent设置有信号;
- SetEvent( m_hSemComm );
- //返回 错误值;
- return EER_CODE_PB9355_COM_REGNUM;
- }
- }
- else{
- //如果m_hSemCom无信号,返回错误;
- return ERR_CODE_PB9355_COM_BUSY;
- }
- /************************************************************************/
- /* readfile ; */
- /************************************************************************/
- //int nRecvLen = 0;
- //BYTE pBuffer[270];
- //memset(pBuffer, 0, 270);
- //nRecvLen = pComm->Read(pBuffer,270);
- SetEvent( m_hSemComm );
- //LOG4C((LOG_NOTICE,"OnlyRequested Sucess"));
- return 0;
- }
- int CPB9355::ReadSetingData(CCommProcess *pComm)
- {
- int nRet = 0;
- /************************************************************************/
- /* SendMsg */
- /************************************************************************/
- BYTE SendPart[4] = {0};
- SendPart[0] = 0xAB;
- SendPart[1] = 0x01;
- SendPart[2] = 0x31;
- SendPart[3] = 0x23;
- //WaitForSingObject();等待有信号;
- if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) {
- //ResetEvent()设置无信号状态
- ResetEvent( m_hSemComm );
- int nResult = pComm->Write(SendPart, 4);
- if( nResult != 4 ) {
- //SetEvent设置有信号;
- SetEvent( m_hSemComm );
- //返回 错误值;
- return EER_CODE_PB9355_COM_REGNUM;
- }
- }
- else{
- //如果m_hSemCom无信号,返回错误;
- return ERR_CODE_PB9355_COM_BUSY;
- }
- /************************************************************************/
- /* readfile ; */
- /************************************************************************/
- int nRecvLen = 0;
- BYTE pBuffer[270];
- memset(pBuffer, 0, 270);
- nRecvLen = pComm->Read(pBuffer,270);
- SetEvent( m_hSemComm );
- //LOG4C((LOG_NOTICE,"ReadSetingData Sucess"));
- return 0;
- }
- // 发送读取设备参数请求;
- int CPB9355::SendReadRequest(
- char szPath[MAX_PATH], // 程序所在路径 ;
- char szIniName[MAX_PATH], // 配置文件名称 ;
- int nCommPort, // 串行端口;
- int nAddr, // 设备地址;
- char szCmd[MAX_CMD], // 请求命令;
- char szMsg[VAR_MSG], // 响应的值 ;
- int nReversed1, // 预留整形参数1接口
- int nReversed2, // 预留整形参数2接口
- int nReversed3, // 预留整形参数3接口
- int nReversed4, // 预留整形参数4接口
- int nReversed5, // 预留整形参数5接口
- float fReversed1, // 预留float参数1接口
- float fReversed2, // 预留float参数2接口
- float fReversed3, // 预留float参数3接口
- char szReversed1[MAX_RESERVED1], // 预留字符数组参数1接口
- char szReversed2[MAX_RESERVED2], // 预留字符数组参数2接口
- char szReversed3[MAX_RESERVED3], // 预留字符数组参数3接口
- char szReversed4[MAX_RESERVED4], // 预留字符数组参数4接口
- char szReversed5[MAX_RESERVED5] // 预留字符数组参数5接口
- )
- {
- int nIndex = 0, nLen = 0;
- BYTE IniSendCMD = 0;
- char szType[TYPE_LENGTH] = {0};
- char szScreen[MAX_CMD] = {0};
- int StartBit = 0;
- int EndBit = 0;
- GetPB9355IniInfo(szPath, szIniName, szCmd, IniSendCMD, szType, nIndex, nLen, StartBit, EndBit);
- CCommProcess *pComm = FindComm(nCommPort);
- if (!m_bRun)
- {
- //Authorization(pComm);
- //OnlyRequested(pComm);
- //
- //ReadSetingData(pComm);
- //LOG4C((LOG_NOTICE,"Sucess Authorization"));
- m_bRun = TRUE;
- }
- if( pComm == NULL ) return -1;
- int nRet = -1;
- if(
- (strlen(m_sz_33Msg) == 0 &&
- (
- strcmp(szCmd, "cmd-1") == 0 || strcmp(szCmd, "cmd-2") == 0 || strcmp(szCmd, "cmd-3") == 0 ||
- strcmp(szCmd, "cmd-4") == 0 || strcmp(szCmd, "cmd-6") == 0 || strcmp(szCmd, "cmd-5") == 0 ||
- strcmp(szCmd, "cmd-7") == 0 || strcmp(szCmd, "cmd-8") == 0 || strcmp(szCmd, "cmd-9") == 0 ||
- strcmp(szCmd, "cmd-10") == 0 || strcmp(szCmd, "cmd-11") == 0 || strcmp(szCmd, "cmd-12") == 0 ||
- strcmp(szCmd, "cmd-13") == 0 || strcmp(szCmd, "cmd-14") == 0
- )) ||
- (strlen(m_sz_34Msg) == 0 &&
- (
- strcmp(szCmd, "cmd-15") == 0 || strcmp(szCmd, "cmd-16") == 0 || strcmp(szCmd, "cmd-17") == 0 ||
- strcmp(szCmd, "cmd-18") == 0 || strcmp(szCmd, "cmd-19") == 0 || strcmp(szCmd, "cmd-20") == 0 ||
- strcmp(szCmd, "cmd-21") == 0 || strcmp(szCmd, "cmd-22") == 0 || strcmp(szCmd, "cmd-23") == 0 ||
- strcmp(szCmd, "cmd-24") == 0 || strcmp(szCmd, "cmd-25") == 0 || strcmp(szCmd, "cmd-26") == 0 ||
- strcmp(szCmd, "cmd-27") == 0 || strcmp(szCmd, "cmd-28") == 0 || strcmp(szCmd, "cmd-29") == 0 || strcmp(szCmd, "cmd-30") == 0 ||
- strcmp(szCmd, "cmd-31") == 0 || strcmp(szCmd, "cmd-32") == 0 || strcmp(szCmd, "cmd-33") == 0 ||
- strcmp(szCmd, "cmd-34") == 0 || strcmp(szCmd, "cmd-35") == 0 || strcmp(szCmd, "cmd-36") == 0 ||
- strcmp(szCmd, "cmd-37") == 0 || strcmp(szCmd, "cmd-38") == 0 || strcmp(szCmd, "cmd-39") == 0 ||
- strcmp(szCmd, "cmd-40") == 0 || strcmp(szCmd, "cmd-41") == 0 || strcmp(szCmd, "cmd-42") == 0 ||
- strcmp(szCmd, "cmd-43") == 0 || strcmp(szCmd, "cmd-44") == 0 || strcmp(szCmd, "cmd-45") == 0 ||
- strcmp(szCmd, "cmd-46") == 0 || strcmp(szCmd, "cmd-47") == 0 || strcmp(szCmd, "cmd-48") == 0 ||
- strcmp(szCmd, "cmd-49") == 0 || strcmp(szCmd, "cmd-50") == 0 || strcmp(szCmd, "cmd-51") == 0 ||
- strcmp(szCmd, "cmd-52") == 0 || strcmp(szCmd, "cmd-53") == 0 ))
- ||
- (strlen(m_sz_35Msg) == 0 &&
- (
- strcmp(szCmd, "cmd-54") == 0 ||strcmp(szCmd, "cmd-55") == 0 || strcmp(szCmd, "cmd-56") == 0 || strcmp(szCmd, "cmd-57") == 0 ||
- strcmp(szCmd, "cmd-58") == 0 || strcmp(szCmd, "cmd-59") == 0 || strcmp(szCmd, "cmd-60") == 0 ||
- strcmp(szCmd, "cmd-61") == 0 || strcmp(szCmd, "cmd-62") == 0 || strcmp(szCmd, "cmd-63") == 0 ||
- strcmp(szCmd, "cmd-64") == 0 || strcmp(szCmd, "cmd-65") == 0 || strcmp(szCmd, "cmd-66") == 0 ||
- strcmp(szCmd, "cmd-67") == 0 || strcmp(szCmd, "cmd-68") == 0 || strcmp(szCmd, "cmd-69") == 0 ||
- strcmp(szCmd, "cmd-60") == 0 || strcmp(szCmd, "cmd-61") == 0 || strcmp(szCmd, "cmd-62") == 0 ||
- strcmp(szCmd, "cmd-63") == 0 || strcmp(szCmd, "cmd-64") == 0 || strcmp(szCmd, "cmd-65") == 0 ||
- strcmp(szCmd, "cmd-66") == 0 || strcmp(szCmd, "cmd-67") == 0 || strcmp(szCmd, "cmd-68") == 0 ||
- strcmp(szCmd, "cmd-69") == 0 || strcmp(szCmd, "cmd-70") == 0 || strcmp(szCmd, "cmd-71") == 0 ||
- strcmp(szCmd, "cmd-72") == 0 || strcmp(szCmd, "cmd-73") == 0 || strcmp(szCmd, "cmd-74") == 0 ||
- strcmp(szCmd, "cmd-75") == 0 || strcmp(szCmd, "cmd-76") == 0 || strcmp(szCmd, "cmd-77") == 0 ||
- strcmp(szCmd, "cmd-78") == 0 || strcmp(szCmd, "cmd-79") == 0 || strcmp(szCmd, "cmd-80") == 0 ||
- strcmp(szCmd, "cmd-81") == 0 || strcmp(szCmd, "cmd-82") == 0 || strcmp(szCmd, "cmd-83") == 0 ||
- strcmp(szCmd, "cmd-84") == 0 || strcmp(szCmd, "cmd-85") == 0 || strcmp(szCmd, "cmd-86") == 0 ||
- strcmp(szCmd, "cmd-87") == 0 || strcmp(szCmd, "cmd-88") == 0 || strcmp(szCmd, "cmd-89") == 0 ||
- strcmp(szCmd, "cmd-90") == 0 || strcmp(szCmd, "cmd-91") == 0 || strcmp(szCmd, "cmd-92") == 0 ||
- strcmp(szCmd, "cmd-93") == 0 || strcmp(szCmd, "cmd-94") == 0 || strcmp(szCmd, "cmd-95") == 0))
- ||
- strcmp(szCmd, "cmd-1") == 0 || strcmp(szCmd, "cmd-15") == 0 ||
- strcmp(szCmd, "cmd-54") == 0
- )
- {
- nRet = GetDeviceParam(pComm, IniSendCMD, szCmd, szMsg, nIndex, nLen, szType );
- if( nRet != 0 ) return nRet;
- }
- if( GetTickCount() - m_dwOnlineTick > 60 *1000 && m_dwOnlineTick > 0 )
- {
- m_devOnline = FALSE;
- }
- else if( GetTickCount() - m_dwOnlineTick< 60 *1000 && m_dwOnlineTick > 0 )
- {
- m_devOnline = TRUE;
- }
- if( m_devOnline == FALSE )
- {
- return -1;
- }
- LOG4C((LOG_NOTICE,"Begin GetData"));
- nRet = Get33VarMsg( szCmd, szMsg, nIndex, nLen, szType, StartBit, EndBit);
- nRet = Get34VarMsg( szCmd, szMsg, nIndex, nLen, szType, StartBit, EndBit);
- nRet = Get35VarMsg( szCmd, szMsg, nIndex, nLen, szType, StartBit, EndBit);
- LOG4C((LOG_NOTICE,"nRet = %d,cmd = %s,值 = %s",nRet,szCmd,szMsg));
- return nRet;
- }
- int CPB9355::GetDeviceParam(
- CCommProcess *pComm,
- BYTE &IniSendCMD,
- char szCmd[MAX_CMD],
- char szMsg[VAR_MSG],
- int &nIndex,
- int &nLen,
- char szType[TYPE_LENGTH])
- {
- int nRet = -1;
- nRet = RequestReadStatus(szCmd, pComm, IniSendCMD);
- if( nRet != 0 )
- {
- return nRet;
- }
- nRet = ResponseReadStatus(pComm, szCmd, szMsg, nIndex, nLen, szType);
- return nRet;
- }
- int CPB9355::RequestReadStatus(char szCmd[MAX_CMD], CCommProcess *pComm, BYTE &IniSendCMD)
- {
- int nRet = -1;
- #if DEBUG_PB9355
- BYTE byArray[5];
- //ZeroMemory(&byArray,5);
- memset(byArray,0,5);
- byArray[0] = 0xAB;
- byArray[1] = 0x01;
- byArray[2] = IniSendCMD; // 命令;
- byArray[3] = GetEndCheck((char *)byArray,3); // 校验;
- //LOG4C((LOG_NOTICE,"Begin WriteFile"));
- if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) { // 有信号才写串口;
- ResetEvent( m_hSemComm );
- int nResult = pComm->Write(byArray, 4);
- if( nResult == 4 ){
- }
- else{
- LOG4C((LOG_NOTICE,"EER_CODE_PB9355_COM_WRITE_DATA"));
- SetEvent( m_hSemComm );
- return EER_CODE_PB9355_COM_WRITE_DATA;
- }
- }
- else{
- LOG4C((LOG_NOTICE,"ERR_CODE_PB9355_COM_BUSY"));
- return ERR_CODE_PB9355_COM_BUSY;
- }
- #endif
- return 0;
- }
- int CPB9355::ResponseReadStatus(
- CCommProcess *pComm,
- char szCmd[MAX_CMD],
- char szMsg[VAR_MSG],
- int &nIndex,
- int &nLen,
- char szType[TYPE_LENGTH]
- )
- {
- #if DEBUG_PB9355
- int nRecvLen = 0;
- char *pBuffer = new char[270];
- memset(pBuffer, 0, 270);
- nRecvLen = pComm->Read((BYTE *)pBuffer,270);
- if( nRecvLen <= 0)
- {
- SetEvent( m_hSemComm );
- if( pBuffer != NULL)
- {
- delete[] pBuffer;
- pBuffer = NULL;
- }
- return ERR_CODE_PB9355_COM_READ_NO_DATA;
- }
- //LOG4C((LOG_NOTICE,"Begin SetData"));
- Set33VarMsg( szCmd, pBuffer);
- Set34VarMsg( szCmd, pBuffer);
- Set35VarMsg( szCmd, pBuffer);
- //LOG4C((LOG_NOTICE,"Sucess SetData"));
- m_dwOnlineTick = GetTickCount();
- SetEvent( m_hSemComm );
- if( pBuffer != NULL)
- {
- delete[] pBuffer;
- pBuffer = NULL;
- }
- #else
- SimulationCommData();
- #endif
- return 0;
- }
- void CPB9355::Set33VarMsg( char szCmd[MAX_CMD], char *pBuffer)
- {
- if( strcmp(szCmd, "cmd-1") == 0 || strcmp(szCmd, "cmd-2") == 0 || strcmp(szCmd, "cmd-3") == 0 ||
- strcmp(szCmd, "cmd-4") == 0 || strcmp(szCmd, "cmd-6") == 0 || strcmp(szCmd, "cmd-5") == 0 ||
- strcmp(szCmd, "cmd-7") == 0 || strcmp(szCmd, "cmd-8") == 0 || strcmp(szCmd, "cmd-9") == 0 ||
- strcmp(szCmd, "cmd-10") == 0 || strcmp(szCmd, "cmd-11") == 0 || strcmp(szCmd, "cmd-12") == 0 ||
- strcmp(szCmd, "cmd-13") == 0 || strcmp(szCmd, "cmd-14") == 0 )
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_sz_33Msg, pBuffer + 4, sizeof(m_sz_33Msg));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CPB9355::Set34VarMsg( char szCmd[MAX_CMD], char *pBuffer)
- {
- if( strcmp(szCmd, "cmd-15") == 0 || strcmp(szCmd, "cmd-16") == 0 || strcmp(szCmd, "cmd-17") == 0 ||
- strcmp(szCmd, "cmd-18") == 0 || strcmp(szCmd, "cmd-19") == 0 || strcmp(szCmd, "cmd-20") == 0 ||
- strcmp(szCmd, "cmd-21") == 0 || strcmp(szCmd, "cmd-22") == 0 || strcmp(szCmd, "cmd-23") == 0 ||
- strcmp(szCmd, "cmd-24") == 0 || strcmp(szCmd, "cmd-25") == 0 || strcmp(szCmd, "cmd-26") == 0 ||
- strcmp(szCmd, "cmd-27") == 0 || strcmp(szCmd, "cmd-28") == 0 || strcmp(szCmd, "cmd-29") == 0 || strcmp(szCmd, "cmd-30") == 0 ||
- strcmp(szCmd, "cmd-31") == 0 || strcmp(szCmd, "cmd-32") == 0 || strcmp(szCmd, "cmd-33") == 0 ||
- strcmp(szCmd, "cmd-34") == 0 || strcmp(szCmd, "cmd-35") == 0 || strcmp(szCmd, "cmd-36") == 0 ||
- strcmp(szCmd, "cmd-37") == 0 || strcmp(szCmd, "cmd-38") == 0 || strcmp(szCmd, "cmd-39") == 0 ||
- strcmp(szCmd, "cmd-40") == 0 || strcmp(szCmd, "cmd-41") == 0 || strcmp(szCmd, "cmd-42") == 0 ||
- strcmp(szCmd, "cmd-43") == 0 || strcmp(szCmd, "cmd-44") == 0 || strcmp(szCmd, "cmd-45") == 0 ||
- strcmp(szCmd, "cmd-46") == 0 || strcmp(szCmd, "cmd-47") == 0 || strcmp(szCmd, "cmd-48") == 0 ||
- strcmp(szCmd, "cmd-49") == 0 || strcmp(szCmd, "cmd-50") == 0 || strcmp(szCmd, "cmd-51") == 0 ||
- strcmp(szCmd, "cmd-52") == 0 || strcmp(szCmd, "cmd-53") == 0 )
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- //memset(m_szTemp,0,1024);
- //memcpy(m_szTemp,pBuffer+4,sizeof(m_szTemp));
- memcpy(m_sz_34Msg, pBuffer + 4, sizeof(m_sz_34Msg));
- LOG4C((LOG_NOTICE,"pBuffer = %s",pBuffer));
- //GetDataSection();
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CPB9355::Set35VarMsg( char szCmd[MAX_CMD], char *pBuffer)
- {
- if( strcmp(szCmd, "cmd-54") == 0 ||strcmp(szCmd, "cmd-55") == 0 || strcmp(szCmd, "cmd-56") == 0 || strcmp(szCmd, "cmd-57") == 0 ||
- strcmp(szCmd, "cmd-58") == 0 || strcmp(szCmd, "cmd-59") == 0 || strcmp(szCmd, "cmd-60") == 0 ||
- strcmp(szCmd, "cmd-61") == 0 || strcmp(szCmd, "cmd-62") == 0 || strcmp(szCmd, "cmd-63") == 0 ||
- strcmp(szCmd, "cmd-64") == 0 || strcmp(szCmd, "cmd-65") == 0 || strcmp(szCmd, "cmd-66") == 0 ||
- strcmp(szCmd, "cmd-67") == 0 || strcmp(szCmd, "cmd-68") == 0 || strcmp(szCmd, "cmd-69") == 0 ||
- strcmp(szCmd, "cmd-60") == 0 || strcmp(szCmd, "cmd-61") == 0 || strcmp(szCmd, "cmd-62") == 0 ||
- strcmp(szCmd, "cmd-63") == 0 || strcmp(szCmd, "cmd-64") == 0 || strcmp(szCmd, "cmd-65") == 0 ||
- strcmp(szCmd, "cmd-66") == 0 || strcmp(szCmd, "cmd-67") == 0 || strcmp(szCmd, "cmd-68") == 0 ||
- strcmp(szCmd, "cmd-69") == 0 || strcmp(szCmd, "cmd-70") == 0 || strcmp(szCmd, "cmd-71") == 0 ||
- strcmp(szCmd, "cmd-72") == 0 || strcmp(szCmd, "cmd-73") == 0 || strcmp(szCmd, "cmd-74") == 0 ||
- strcmp(szCmd, "cmd-75") == 0 || strcmp(szCmd, "cmd-76") == 0 || strcmp(szCmd, "cmd-77") == 0 ||
- strcmp(szCmd, "cmd-78") == 0 || strcmp(szCmd, "cmd-79") == 0 || strcmp(szCmd, "cmd-80") == 0 ||
- strcmp(szCmd, "cmd-81") == 0 || strcmp(szCmd, "cmd-82") == 0 || strcmp(szCmd, "cmd-83") == 0 ||
- strcmp(szCmd, "cmd-84") == 0 || strcmp(szCmd, "cmd-85") == 0 || strcmp(szCmd, "cmd-86") == 0 ||
- strcmp(szCmd, "cmd-87") == 0 || strcmp(szCmd, "cmd-88") == 0 || strcmp(szCmd, "cmd-89") == 0 ||
- strcmp(szCmd, "cmd-90") == 0 || strcmp(szCmd, "cmd-91") == 0 || strcmp(szCmd, "cmd-92") == 0 ||
- strcmp(szCmd, "cmd-93") == 0 || strcmp(szCmd, "cmd-94") == 0 || strcmp(szCmd, "cmd-95") == 0 )
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_sz_35Msg, pBuffer + 4, sizeof(m_sz_35Msg));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- int CPB9355::Get33VarMsg( char szCmd[MAX_CMD], char szMsg[VAR_MSG], int &nIndex, int &nLen, char szType[TYPE_LENGTH], int startBit, int endBit )
- {
- int nRet = 0;
- if( strcmp(szCmd, "cmd-1") == 0 || strcmp(szCmd, "cmd-2") == 0 || strcmp(szCmd, "cmd-3") == 0 ||
- strcmp(szCmd, "cmd-4") == 0 || strcmp(szCmd, "cmd-6") == 0 || strcmp(szCmd, "cmd-5") == 0 ||
- strcmp(szCmd, "cmd-7") == 0 || strcmp(szCmd, "cmd-8") == 0 || strcmp(szCmd, "cmd-9") == 0 ||
- strcmp(szCmd, "cmd-10") == 0 || strcmp(szCmd, "cmd-11") == 0 || strcmp(szCmd, "cmd-12") == 0 ||
- strcmp(szCmd, "cmd-13") == 0 || strcmp(szCmd, "cmd-14") == 0)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataProcess(szType, m_sz_33Msg + nIndex, szMsg, nLen, startBit, endBit);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CPB9355::Get34VarMsg( char szCmd[MAX_CMD], char szMsg[VAR_MSG], int &nIndex, int &nLen, char szType[TYPE_LENGTH], int startBit, int endBit )
- {
- int nRet = 0;
- if( strcmp(szCmd, "cmd-15") == 0 || strcmp(szCmd, "cmd-16") == 0 || strcmp(szCmd, "cmd-17") == 0 ||
- strcmp(szCmd, "cmd-18") == 0 || strcmp(szCmd, "cmd-19") == 0 || strcmp(szCmd, "cmd-20") == 0 ||
- strcmp(szCmd, "cmd-21") == 0 || strcmp(szCmd, "cmd-22") == 0 || strcmp(szCmd, "cmd-23") == 0 ||
- strcmp(szCmd, "cmd-24") == 0 || strcmp(szCmd, "cmd-25") == 0 || strcmp(szCmd, "cmd-26") == 0 ||
- strcmp(szCmd, "cmd-27") == 0 || strcmp(szCmd, "cmd-28") == 0 || strcmp(szCmd, "cmd-29") == 0 || strcmp(szCmd, "cmd-30") == 0 ||
- strcmp(szCmd, "cmd-31") == 0 || strcmp(szCmd, "cmd-32") == 0 || strcmp(szCmd, "cmd-33") == 0 ||
- strcmp(szCmd, "cmd-34") == 0 || strcmp(szCmd, "cmd-35") == 0 || strcmp(szCmd, "cmd-36") == 0 ||
- strcmp(szCmd, "cmd-37") == 0 || strcmp(szCmd, "cmd-38") == 0 || strcmp(szCmd, "cmd-39") == 0 ||
- strcmp(szCmd, "cmd-40") == 0 || strcmp(szCmd, "cmd-41") == 0 || strcmp(szCmd, "cmd-42") == 0 ||
- strcmp(szCmd, "cmd-43") == 0 || strcmp(szCmd, "cmd-44") == 0 || strcmp(szCmd, "cmd-45") == 0 ||
- strcmp(szCmd, "cmd-46") == 0 || strcmp(szCmd, "cmd-47") == 0 || strcmp(szCmd, "cmd-48") == 0 ||
- strcmp(szCmd, "cmd-49") == 0 || strcmp(szCmd, "cmd-50") == 0 || strcmp(szCmd, "cmd-51") == 0 ||
- strcmp(szCmd, "cmd-52") == 0 || strcmp(szCmd, "cmd-53") == 0 )
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataProcess(szType, m_sz_34Msg + nIndex, szMsg, nLen, startBit, endBit);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CPB9355::Get35VarMsg( char szCmd[MAX_CMD], char szMsg[VAR_MSG], int &nIndex, int &nLen, char szType[TYPE_LENGTH], int startBit, int endBit )
- {
- int nRet = 0;
- if( strcmp(szCmd, "cmd-54") == 0 ||strcmp(szCmd, "cmd-55") == 0 || strcmp(szCmd, "cmd-56") == 0 || strcmp(szCmd, "cmd-57") == 0 ||
- strcmp(szCmd, "cmd-58") == 0 || strcmp(szCmd, "cmd-59") == 0 || strcmp(szCmd, "cmd-60") == 0 ||
- strcmp(szCmd, "cmd-61") == 0 || strcmp(szCmd, "cmd-62") == 0 || strcmp(szCmd, "cmd-63") == 0 ||
- strcmp(szCmd, "cmd-64") == 0 || strcmp(szCmd, "cmd-65") == 0 || strcmp(szCmd, "cmd-66") == 0 ||
- strcmp(szCmd, "cmd-67") == 0 || strcmp(szCmd, "cmd-68") == 0 || strcmp(szCmd, "cmd-69") == 0 ||
- strcmp(szCmd, "cmd-60") == 0 || strcmp(szCmd, "cmd-61") == 0 || strcmp(szCmd, "cmd-62") == 0 ||
- strcmp(szCmd, "cmd-63") == 0 || strcmp(szCmd, "cmd-64") == 0 || strcmp(szCmd, "cmd-65") == 0 ||
- strcmp(szCmd, "cmd-66") == 0 || strcmp(szCmd, "cmd-67") == 0 || strcmp(szCmd, "cmd-68") == 0 ||
- strcmp(szCmd, "cmd-69") == 0 || strcmp(szCmd, "cmd-70") == 0 || strcmp(szCmd, "cmd-71") == 0 ||
- strcmp(szCmd, "cmd-72") == 0 || strcmp(szCmd, "cmd-73") == 0 || strcmp(szCmd, "cmd-74") == 0 ||
- strcmp(szCmd, "cmd-75") == 0 || strcmp(szCmd, "cmd-76") == 0 || strcmp(szCmd, "cmd-77") == 0 ||
- strcmp(szCmd, "cmd-78") == 0 || strcmp(szCmd, "cmd-79") == 0 || strcmp(szCmd, "cmd-80") == 0 ||
- strcmp(szCmd, "cmd-81") == 0 || strcmp(szCmd, "cmd-82") == 0 || strcmp(szCmd, "cmd-83") == 0 ||
- strcmp(szCmd, "cmd-84") == 0 || strcmp(szCmd, "cmd-85") == 0 || strcmp(szCmd, "cmd-86") == 0 ||
- strcmp(szCmd, "cmd-87") == 0 || strcmp(szCmd, "cmd-88") == 0 || strcmp(szCmd, "cmd-89") == 0 ||
- strcmp(szCmd, "cmd-90") == 0 || strcmp(szCmd, "cmd-91") == 0 || strcmp(szCmd, "cmd-92") == 0 ||
- strcmp(szCmd, "cmd-93") == 0 || strcmp(szCmd, "cmd-94") == 0 || strcmp(szCmd, "cmd-95") == 0 )
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataProcess(szType, m_sz_35Msg + nIndex, szMsg, nLen, startBit, endBit);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CPB9355::GetPB9355IniInfo(
- char szPath[MAX_PATH],
- char szIniName[MAX_PATH],
- char szCmd[MAX_CMD],
- BYTE &IniSendCMD,
- char szType[TYPE_LENGTH],
- int &nIndex,
- int &nLen,
- int &StaBit,
- int &EndBit
- )
- {
- char szFile[MAX_PATH + 1] = "";
- char szSendCmd[3] = {0};
- memset(szType, 0, TYPE_LENGTH);
- wsprintf(szFile, "%s\\config\\%s", szPath, szIniName);
- GetPrivateProfileString(szCmd, "SendCmd", "", szSendCmd, MAX_CMD, szFile);
- IniSendCMD = AsciiToBYTE(szSendCmd[0])*16 + AsciiToBYTE(szSendCmd[1]) ;
- GetPrivateProfileString(szCmd, "Type", "", szType, TYPE_LENGTH, szFile);
- nIndex = GetPrivateProfileInt(szCmd, "Index", 0, szFile);
- nLen = GetPrivateProfileInt(szCmd, "Len", 0, szFile);
- StaBit = GetPrivateProfileInt(szCmd,"Sbit",0,szFile);
- EndBit = GetPrivateProfileInt(szCmd,"Ebit",0,szFile);
- return 0;
- }
- int CPB9355::GetEndCheck(char *buf,int len)
- {
- int iSum = 0;
- for (int i = 0; i < len; i++)
- {
- iSum += (BYTE)buf[i];
- }
- // 再求低8位,取反加+;
- iSum = iSum & 0x00FF;
- return iSum = ~iSum+1;
- }
- void CPB9355::GetDataSection(/*char *pBuf*/)
- {
- int nBlockLen1 = 0, nBlockLen2 = 0,nBlockLen3 = 0,nBlockLen4 =0;
- nBlockLen1 = m_szTemp[2] + 5;
- nBlockLen2 = m_szTemp[nBlockLen1+2] + 5;
- nBlockLen3 = m_szTemp[nBlockLen2 + nBlockLen1 +2] + 5;
- nBlockLen4 = m_szTemp[nBlockLen3 + nBlockLen2 + nBlockLen1] + 5 ;
- memcpy(m_sz_34Msg,m_szTemp + 4,nBlockLen1 - 5);
- memcpy(m_sz_34Msg + nBlockLen1 - 5,m_szTemp + nBlockLen1 + 4,nBlockLen2 - 5);
- }
- void CPB9355::PCRTo16HEXPCRT(char *szSour, char *pDsc,int len)
- {
- #if 1
- for (int i = 0,j = 0; i < len; i++)
- {
- pDsc[j++] = ByteToAscii((szSour[len -i-1] >> 4 ) & 0x0F);
- pDsc[j++] = ByteToAscii(szSour[len -i-1] & 0x0F);
- }
- #else
- int j = 0;
- int nNo = 0;
- for (int i = 0,j = 0; i < len; i++)
- {
- nNo = j++;
- pDsc[nNo] = ByteToAscii((szSour[len -i-1] >> 4 ) & 0x0F);
- nNo = j++;
- pDsc[nNo] = ByteToAscii(szSour[len -i-1] & 0x0F);
- }
- #endif
- }
- void CPB9355::ByteTo16HEXAscii(BYTE &bySour, char *pDsc)
- {
- pDsc[0] = ByteToAscii((bySour >> 4 ) & 0x0F);
- pDsc[1] = ByteToAscii(bySour & 0x0F);
- }
- //char* CPB9355::ByteTo16HEXAscii(BYTE &bySour)
- //{
- // //char *pDsc = new char[3];
- // //memset(pDsc,0,3);
- // char pDsc[3] = {0};
- //
- // pDsc[0] = ByteToAscii((bySour >> 4 ) & 0x0F);
- // pDsc[1] = ByteToAscii(bySour & 0x0F);
- //
- // return pDsc;
- //}
- void CPB9355::DataProcess(const char *szType, char *szMsg, char *szConvMsg, int len, int StaBit, int EndBit)
- {
- if ( strcmp(szType, "HEX") == 0)
- {
- //LOG4C((LOG_NOTICE,"szMsg = %s",szMsg));
- char abcd[5] = {0};
- abcd[0] = szMsg[3];
- abcd[1] = szMsg[2];
- abcd[2] = szMsg[1];
- abcd[3] = szMsg[0];
- LOG4C_HEX_DUMP((LOG_NOTICE, szMsg, sizeof(szMsg)));
- LOG4C_HEX_DUMP((LOG_NOTICE, abcd, sizeof(abcd)));
- //LOG4C((LOG_NOTICE,"abcd = %s",abcd));
- float fNum = *(float*)abcd;
- sprintf(szConvMsg,"%f",fNum);
- //LOG4C((LOG_NOTICE,"szConvMsg = %s",szConvMsg));
- }
- else if ( strcmp(szType, "BIT") == 0 )
- {
- BitDataProcess((BYTE)szMsg[0],szConvMsg,StaBit,EndBit);
- }
- else if (strcmp(szType,"FLOAT") == 0)
- {
- float fNum = *(float*)szMsg;
- sprintf(szConvMsg,"%f",fNum);
- }
- }
- void CPB9355::BitDataProcess(const BYTE &bySour, char *szRecv,int &StaBit,int &EndBit)
- {
- int ByteBit = 0;
- int sum = bySour;
- #if 0
- switch(StaBit)
- {
- case 7:
- ByteBit = sum & 0x01;
- break;
- case 6:
- ByteBit = (sum & 0x02) / 0x02 ;
- break;
- case 5:
- ByteBit = (sum & 0x04) / 0x04 ;
- break;
- case 4:
- ByteBit = (sum & 0x08) / 0x08 ;
- break;
- case 3:
- ByteBit = (sum & 0x10) / 0x10 ;
- break;
- case 2:
- ByteBit = (sum & 0x20) / 0x20 ;
- break;
- case 1:
- ByteBit = (sum & 0x40) / 0x40 ;
- break;
- case 0:
- ByteBit = (sum & 0x80) / 0x80;
- break;
- }
- #else
- switch(StaBit)
- {
- case 0:
- ByteBit = sum & 0x01;
- break;
- case 1:
- ByteBit = (sum & 0x02) / 0x02 ;
- break;
- case 2:
- ByteBit = (sum & 0x04) / 0x04 ;
- break;
- case 3:
- ByteBit = (sum & 0x08) / 0x08 ;
- break;
- case 4:
- ByteBit = (sum & 0x10) / 0x10 ;
- break;
- case 5:
- ByteBit = (sum & 0x20) / 0x20 ;
- break;
- case 6:
- ByteBit = (sum & 0x40) / 0x40 ;
- break;
- case 7:
- ByteBit = (sum & 0x80) / 0x80;
- break;
- }
- #endif
- sprintf(szRecv,"%d",ByteBit);
- }
- void CPB9355::SimulationCommData()
- {
- char sztemp[1024] = {0};
- sztemp[0] = 0xAB ;
- sztemp[1] = 0x04 ;
- sztemp[2] = 0x40 ;
- sztemp[3] = 0x01 ;
- // 输出线电压;
- sztemp[4] = 0x00;
- sztemp[5] = 0x00;
- sztemp[6] = 0xA0;
- sztemp[7] = 0x40;
- sztemp[8] = 0x00;
- sztemp[9] = 0x00;
- sztemp[10] = 0xC0;
- sztemp[11] = 0x40;
- sztemp[12] = 0x00;
- sztemp[13] = 0x00;
- sztemp[14] = 0xC0;
- sztemp[15] = 0x40;
- // 输入线电压;
- sztemp[16] = 0x00 ;
- sztemp[17] = 0x30;
- sztemp[18] = 0x3C;
- sztemp[19] = 0x45;
- sztemp[20] = 0x00;
- sztemp[21] = 0x10;
- sztemp[22] = 0x85;
- sztemp[23] = 0x45;
- sztemp[24] = 0x00;
- sztemp[25] = 0x00;
- sztemp[26] = 0x35;
- sztemp[27] = 0x3F;
- // 旁路线电压;
- sztemp[28] = 0x00;
- sztemp[29] = 0xEC;
- sztemp[30] = 0x47;
- sztemp[31] = 0x42;
- sztemp[32] = 0x00;
- sztemp[33] = 0xEC;
- sztemp[34] = 0x47;
- sztemp[35] = 0x42;
- sztemp[36] = 0x00;
- sztemp[37] = 0xEC;
- sztemp[38] = 0x47;
- sztemp[39] = 0x42;
- // 主输入电流;
- sztemp[40] = 0x00;
- sztemp[41] = 0xEC;
- sztemp[42] = 0x47;
- sztemp[43] = 0x42;
- sztemp[44] = 0x00;
- sztemp[45] = 0x00;
- sztemp[46] = 0x00;
- sztemp[47] = 0x00;
- sztemp[48] = 0x80;
- sztemp[49] = 0xD9;
- sztemp[50] = 0xCE;
- sztemp[51] = 0x43;
- // 输出功率;
- sztemp[52] = 0x00 ;
- sztemp[53] = 0xCC;
- sztemp[54] = 0xC7;
- sztemp[55] = 0x42;
- // 输入功率;
- sztemp[56] = 0x7F;
- sztemp[57] = 0x70;
- sztemp[58] = 0x00;
- sztemp[59] = 0x00;
- // 输出电量
- sztemp[60] = 0x00 ;
- sztemp[61] = 0xCD;
- sztemp[62] = 0xAC;
- sztemp[63] = 0x43;
- // 输入电量;
- sztemp[64] = 0x00;
- sztemp[65] = 0x00;
- sztemp[66] = 0xE8;
- sztemp[67] = 0x41;
- // 输出/输入功率因子;
- sztemp[68] = 0x4A;
- sztemp[69] = 0xAB;
- sztemp[70] = 0x04;
- sztemp[71] = 0x40;
- sztemp[72] = 0x02;
- sztemp[73] = 0x00;
- sztemp[74] = 0xCD;
- sztemp[75] = 0xAC;
- sztemp[76] = 0x43;
- sztemp[77] = 0x00;
- sztemp[78] = 0x00;
- sztemp[79] = 0x20;
- sztemp[80] = 0x41;
- sztemp[81] = 0x00;
- sztemp[82] = 0x00;
- sztemp[83] = 0x30;
-
- sztemp[84] = 0x42;
- sztemp[85] = 0x00;
- sztemp[86] = 0x9A;
- sztemp[87] = 0x5E;
- sztemp[88] = 0x43;
- sztemp[89] = 0x00;
- sztemp[90] = 0x00;
- sztemp[91] = 0x5F;
- sztemp[92] = 0x43;
- sztemp[93] = 0x00;
- sztemp[94] = 0xE6;
- sztemp[95] = 0x5D;
- sztemp[96] = 0x43;
- sztemp[97] = 0x00;
- sztemp[98] = 0x4D;
- sztemp[99] = 0x5F;
- sztemp[100] = 0x43;
- sztemp[101] = 0x00;
- sztemp[102] = 0x1A;
- sztemp[103] = 0x5D;
- sztemp[104] = 0x43;
- sztemp[105] = 0x00;
- sztemp[106] = 0xCD;
- sztemp[107] = 0x5D;
- sztemp[108] = 0x43;
- sztemp[109] = 0x00;
- sztemp[110] = 0xD0;
- sztemp[111] = 0x6C;
- sztemp[112] = 0x41;
- sztemp[113] = 0x00;
- sztemp[114] = 0xC0;
- sztemp[115] = 0x85;
- sztemp[116] = 0x40;
- sztemp[117] = 0x00;
- sztemp[118] = 0xA0;
- sztemp[119] = 0xB1;
- sztemp[120] = 0x40;
- sztemp[121] = 0x00;
- sztemp[122] = 0x60;
- sztemp[123] = 0x03;
- sztemp[124] = 0x41;
- sztemp[125] = 0x00;
- sztemp[126] = 0x00;
- sztemp[127] = 0xB0;
- sztemp[128] = 0x41;
- sztemp[129] = 0x00;
- sztemp[130] = 0x00;
- sztemp[131] = 0xB0;
- sztemp[132] = 0x41;
- sztemp[133] = 0x00;
- sztemp[134] = 0x00;
- sztemp[135] = 0xB0;
- sztemp[136] = 0x41;
- sztemp[137] = 0xCD;
- sztemp[138] = 0xAB;
- sztemp[139] = 0x04;
- sztemp[140] = 0x2C;
- sztemp[141] = 0x83;
- sztemp[142] = 0x00;
- sztemp[143] = 0x60;
- sztemp[144] = 0x6A;
- sztemp[145] = 0x46;
- sztemp[146] = 0x21;
- sztemp[147] = 0x11;
- sztemp[148] = 0x11;
- sztemp[149] = 0xA0;
- sztemp[150] = 0x69;
- sztemp[151] = 0x21;
- sztemp[152] = 0x11;
- sztemp[153] = 0x01;
- sztemp[154] = 0x00;
- sztemp[155] = 0x66;
- sztemp[156] = 0x5B;
- sztemp[157] = 0x43;
- sztemp[158] = 0x00;
- sztemp[159] = 0x1A;
- sztemp[160] = 0x5B;
- sztemp[161] = 0x43;
- sztemp[162] = 0x00;
- sztemp[163] = 0xCD;
- sztemp[164] = 0x5A;
- sztemp[165] = 0x43;
- sztemp[166] = 0x00;
- sztemp[167] = 0xC0;
- sztemp[168] = 0x7A;
- sztemp[169] = 0x44;
- sztemp[170] = 0x00;
- sztemp[171] = 0x40;
- sztemp[172] = 0x30;
- sztemp[173] = 0x44;
- sztemp[174] = 0x00;
- sztemp[175] = 0x40;
- sztemp[176] = 0xA2;
- sztemp[177] = 0x44;
- sztemp[178] = 0x00;
- sztemp[179] = 0xA0;
- sztemp[180] = 0x8C;
- sztemp[181] = 0x45;
- sztemp[182] = 0x06;
- sztemp[183] = 0x00;
- sztemp[184] = 0x00;
- sztemp[185] = 0x00;
- sztemp[186] = 0x1E;
- //memcpy(m_szTemp,sztemp,187);
- memcpy(m_sz_34Msg,sztemp,187);
- //GetDataSection();
-
- }
|