Re: Custom app & Winlogon.exe fighting

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On 6 Nov 2006 14:53:21 -0800, ckramer7070@xxxxxxxxx wrote:


Really odd functioning from the MSComm, we can open and set properties
for the port and run data through it correctly but when it comes time
to close the program and kill the port the computer will slow down
dramatically. Funny thing is if we initialize the same comm again the
lag goes away. Tried various things with the thresholds and buffer
clearing, not yet resolved. We are moving data RS232 to a converter
then RS485 to 2 temp-controllers, have any suggestions on MSComm
properties setup?


Finally got this resolved by setting the MSComm.RThreshold = 0 while
running a do loop to check the incomming data and exit when it has
received the full signal. I guess setting the RThreshold to 0 allows
the MSComm to be skipped and doesn't slow down the signal as much.

MSComm.RThreshold = 0

<quote>
Setting the RThreshold property to 0 (the default) disables generating
the OnComm event when characters are received.
</quote>

Since you are reading the characters yourself, you are not relying on
the OnComm event to receive the characters.

This is Ok if you are doing a 'question and answer' type thing, but
would be a problem if your App was meant to always 'listen'.

It sounds like your App was getting hammered with OnComm events when
you were trying to shut it down.

Glad you've found a solution.
.



Relevant Pages

  • Re: Serial Port Class ?
    ... OnComm event when characters are received. ... > Being someone who reads these vb and API groups regularly, I seem to> remember someone mentioning that they have a serial port class for VB> (for replacing the MSCOMM control) on their website, but for the life of> me, I couldn't find any references to it. ... All I'm doing is sending a few> characters to it to change to a different channel, ...
    (microsoft.public.vb.enterprise)
  • Re: Serial Port Class ?
    ... OnComm event when characters are received. ... > Being someone who reads these vb and API groups regularly, I seem to> remember someone mentioning that they have a serial port class for VB> (for replacing the MSCOMM control) on their website, but for the life of> me, I couldn't find any references to it. ... All I'm doing is sending a few> characters to it to change to a different channel, ...
    (microsoft.public.vb.winapi)
  • Re: Please help with this.
    ... returns a CString. ... it also seems possible you will drop characters by ... >>> void CPSMDlg::OnOnCommMscomm1 ... >> // causes the OnComm event to NOT fire when a character is detected ...
    (microsoft.public.vc.mfc)
  • Re: Serial COM port communication problems
    ... serial port. ... The receiving buffer is read by setting the mask to rx flag being the ... sub-packages arrive in succession and some sub-packages are lost. ... But this should not cause a loss of data, assuming you are reading the actual number of characters retured by WaitCommEvent. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: [PATCH: 2/2] [SERIAL] avoid stalling suspend if serial port wont drain
    ... prefer - the system being prevented from suspending and losing complete ... The only way you could do that on 8250 is to clear the RX FIFO, ... wait for the port to transmit all its characters into the RX ...
    (Linux-Kernel)