Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

pra84veen

@pra84veen
About
Posts
9
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Regarding System Error Code 995 in Serial Communication
    P pra84veen

    even if i change the values of commtimeouts to

    GetCommTimeouts(m_comPortHandle, &sCommTimeOuts);
    sCommTimeOuts.ReadIntervalTimeout = 100; //[ms]
    sCommTimeOuts.ReadTotalTimeoutMultiplier = 10; //[ms]
    sCommTimeOuts.ReadTotalTimeoutConstant = 500; //[ms]
    sCommTimeOuts.WriteTotalTimeoutMultiplier = 10; //[ms]
    sCommTimeOuts.WriteTotalTimeoutConstant = 100; //[ms]
    SetCommTimeouts(m_comPortHandle, &sCommTimeOuts);

    i dint observe any change.

    C / C++ / MFC help c++ com debugging tutorial

  • Regarding System Error Code 995 in Serial Communication
    P pra84veen

    sorry, i dint get you

    C / C++ / MFC help c++ com debugging tutorial

  • Regarding System Error Code 995 in Serial Communication
    P pra84veen

    Even after modification also, iam not able to collect the data The serial port timeouts are

    GetCommTimeouts(m_comPortHandle, &sCommTimeOuts);
    sCommTimeOuts.ReadIntervalTimeout = 5;//100; //[ms]
    sCommTimeOuts.ReadTotalTimeoutMultiplier = 1;//10; //[ms]
    sCommTimeOuts.ReadTotalTimeoutConstant = 1;//500; //[ms]
    sCommTimeOuts.WriteTotalTimeoutMultiplier = 1;//10; //[ms]
    sCommTimeOuts.WriteTotalTimeoutConstant = 1;//100; //[ms]
    SetCommTimeouts(m_comPortHandle, &sCommTimeOuts);

    Thanks & Regards, Praveen

    C / C++ / MFC help c++ com debugging tutorial

  • Regarding System Error Code 995 in Serial Communication
    P pra84veen

    the value received by the ulLengthReceived is 0.

    void CER2TSerialDlg::OnStartThread()
    {
    CWinThread *pThread = NULL;
    m_SerialCommn->bOpen()
    pThread = AfxBeginThread((AFX_THREADPROC)ReadFromModuleThread,NULL);
    }

    UINT CER2TSerialDlg::ReadFromModuleThread(LPVOID pPARAM)
    {
    unsigned char ucLengthExpected=10;
    char chBuffer[FIFO_SIZE]={0};
    unsigned short usReceived=0;

    while(TRUE)
    {
    m_SerialCommn->bReceiveBytes(chBuffer,ucLengthExpected,&usReceived);
    }
    return 0;
    }

    bool CSerialPort::bReceiveBytes(char* x_pcBuffer,
    unsigned short x_usLengthExpected,
    unsigned short *x_pusLengthReceived )
    {

    unsigned long ulLengthReceived=0;
    int iResult;
    iResult = ReadFile(m_comPortHandle,
    x_pcBuffer[0],
    x_usLengthExpected,
    ulLengthReceived,
    NULL );
    DWORD err1 = GetLastError();
    *x_pusLengthReceived = (unsigned short)ulLengthReceived;
    return( iResult );

    }/

    Regards praveen

    modified on Wednesday, June 11, 2008 1:48 AM

    C / C++ / MFC help c++ com debugging tutorial

  • Regarding System Error Code 995 in Serial Communication
    P pra84veen

    hello, thanks for your reply... even though if i replace x_pcBuffer instead of x_pcBuffer[0], i dint get any data into the buffer. but here the return values for ReadFile is 1 but iam unable to capture the data.. Thanks & Regards, praveen

    C / C++ / MFC help c++ com debugging tutorial

  • Regarding System Error Code 995 in Serial Communication
    P pra84veen

    Iam calling this function for capturing data. The ReadFile() returns 0 value and GetLastError() gives error 995 bool CSerialPort::bReceiveBytes( unsigned char* x_pcBuffer, unsigned short x_usLengthExpected, unsigned short *x_pusLengthReceived ) { bool bResult = FALSE; unsigned long ulLengthReceived=0; int iResult; iResult = ReadFile( m_comPortHandle, x_pcBuffer[0], x_usLengthExpected, &ulLengthReceived, NULL ); DWORD err1 = GetLastError(); *x_pusLengthReceived = (unsigned short)ulLengthReceived; return( bResult ); }

    C / C++ / MFC help c++ com debugging tutorial

  • Regarding System Error Code 995 in Serial Communication
    P pra84veen

    hi one and all, iam having a problem with accessing serial port in my pc. i have developed an application which access the serial port in VC++ 6.0.After configuring the Serial port to 115200, iam able to send the data to the com port using WriteFile().But, iam unable to receive the data from the com port through ReadFile() operation and i have checked the error by using GetLastError() and it is given as 995(system error code).Even though i have restarted my system several times,iam unable to debug. Please help me why this error is getting and how to fix this error? Thanks in advance Regards, Praveen

    modified on Monday, June 9, 2008 8:23 AM

    C / C++ / MFC help c++ com debugging tutorial

  • regarding System Error Code 995
    P pra84veen

    hi one and all, iam having a problem with accessing serial port in my pc. i have developed an application which access the serial port in VC++ 6.0.After configuring the Serial port to 115200, iam able to send the data to the com port using WriteFile().But, iam unable to receive the data from the com port through ReadFile() operation and i have checked the error by using GetLastError() and it is given as 995(system error code).Even though i have restarted my system several times,iam unable to debug. Please help me why this error is getting and how to fix this error? Thanks in advance Regards, Praveen

    COM help c++ com debugging tutorial

  • [Message Deleted]
    P pra84veen

    [Message Deleted]

    COM
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups