Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by seeplusplusnewbie

  1. seeplusplusnewbie

    Multithread Serial Communication App using Entire CPU Time

    tmiketx: Thank you for that very well thoughtout response to my problem. However, this problem has been solved for a while now but I forgot to update the thread. However. I guess you could help me with another problem. Right now my Serial Library works. i can read/write correctly, However i do...
  2. seeplusplusnewbie

    Multithread Serial Communication App using Entire CPU Time

    After doing some tests I have concluded that it is indeed the "infinite for loop" that is causing the cpu usage to jump up completely. So now its time to figure out how to resolve this. If i didn't mention it aready, this is what I wanted to do: call worker thread a.k.a. Read() read data from...
  3. seeplusplusnewbie

    Multithread Serial Communication App using Entire CPU Time

    Could you please elaborate on that? I have used the WaitCommEvent() Before with the EV_CHAR event and it just didnt work with what I was doing. I made my own routine to wait until all of the byte I wanted was there and it was ok. Check below: for( ; dwSize < 5 ; ) { ReadFile(hComm, &szBuf...
  4. seeplusplusnewbie

    Multithread Serial Communication App using Entire CPU Time

    I made a Multithreaded serial communication program (GUI Thread and Worker Thread) where the flow of data is continuous. Thus the way I have it is I use an Infinite loop of (Read data, do something with data and loopback to read more data in my worker thread), however this causes the cpu time to...
  5. seeplusplusnewbie

    How to know there is no Data @ Serial Port

    fair enough. Would you suggest I SetCommMask() and wait for EV_RING (A ring indicator was detected.) Also before I failed to mention one detail: I am neither the DTE or DCE as nothing is communicating with me directly, What I am doing is snooping on the communication of 2 other machines and...
  6. seeplusplusnewbie

    How to know there is no Data @ Serial Port

    Here is my current Read routine. it is called from a loop: void CflowlogDlg::Read() { HRESULT hResult = S_OK; DWORD dwEventMask; if(!SetCommMask(hComm, EV_RXCHAR)) hResult = S_OK; if(WaitCommEvent(hComm, &dwEventMask, NULL)) { BYTE szBuf; DWORD dwIncommingReadSize; do {...
  7. seeplusplusnewbie

    How to know there is no Data @ Serial Port

    thanks for the post ArkM, I had looked at that Old Post on the Win32 Serial Communication, but your post reminded me to go back and look and low and behold I found a good option. I could use CommEvents to know when there is no more data to be read from the port. I tried to implement by reading...
  8. seeplusplusnewbie

    How to know there is no Data @ Serial Port

    This is actually a generalized question, but I am writing in C++, so I am putting it here: In regards to Reading from the serial port in C++ using the Win32 API: Is there a way to know when there is no data to be read from the port without using flow control? Basically my situation is this: I...
  9. seeplusplusnewbie

    C++ Serial I/O Comm Library

    Does anyone know of a good place that has a tutorial or complete "working" programs that use C++ Serial I/O Comm routines? I have found some stuff, but all have many errors which doesn't help me since I dont know much of it to begin with. I am using MSoft's Visual Studio.NET just to let you know...

Part and Inventory Search

Back
Top