From: Arkady Frenkel on
Do you mean you disable and enable driver and that not work ?...
That stop driver to work and restart with full initialization.
You did something incorrectly IMHO, try do the same with device manager ( my
computer->View system info->Hardware->Device manager )
Arkady
"wangzhong" <wzhy2000(a)hotmail.com> wrote in message
news:e6PDfav3FHA.3592(a)TK2MSFTNGP12.phx.gbl...
> sorry, It did not work.
>
> I want to know the difference between the app restart and the com restart
> about serial port initializtion
>
> ------or------
>
> When COM port is opened first in a process, what is done for COM
> initializtion
> in Windows kernel ?
>
>
> "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
> news:O7qk6br2FHA.700(a)TK2MSFTNGP15.phx.gbl...
>> I will try to do it, thank you very much.
>>
>> "Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
>> news:e5jYeok2FHA.2816(a)tk2msftngp13.phx.gbl...
>> > Additionally : good one is restart command of devcon
>> > Arkady
>> >
>> > "Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
>> > news:OCMkFYL2FHA.464(a)TK2MSFTNGP15.phx.gbl...
>> > > Try to use devcon from DDK to check port status and disable/enable
>> > > the
>> > > port
>> > > Arkady
>> > >
>> > > "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
>> > > news:eQe%23e1G2FHA.2964(a)TK2MSFTNGP09.phx.gbl...
>> > >> Hello.
>> > >>
>> > >> I have written a modem comunication app and got a very strange
> problem.
>> > >>
>> > >> When CE_RXPARITY error is catched by my app, I use ClearCommError()
>> > >> to reset this error. but COM access become abnormally since this
>> > >> connntion.
>> > >> My app only can get the first telegram from any connection.
>> > >>
>> > >> It is failed to repair this problem that I tried to reopen the
>> > >> serial
>> > >> port,
>> > >> But if I close my app, then I reopen it, the com port become
> normally.
>> > >>
>> > >> I use CreateFile() to open serial port, CloseHandle() to close
> serial
>> > >> port.
>> > >> Why can I didn't get the same result as application restart.
>> > >>
>> > >> Any help would be greatly appreciated.
>> > >>
>> > >> ---------------------------
>> > >> wz
>> > >>
>> > >>
>> > >
>> > >
>> >
>> >
>>
>


From: Armin Schoffmann on

"wangzhong" <wzhy2000(a)hotmail.com> schrieb im Newsbeitrag
news:eQe%23e1G2FHA.2964(a)TK2MSFTNGP09.phx.gbl...
> Hello.
>
> I have written a modem comunication app and got a very strange problem.
>
> When CE_RXPARITY error is catched by my app, I use ClearCommError()
> to reset this error. but COM access become abnormally since this
> connntion.
> My app only can get the first telegram from any connection.
>
> It is failed to repair this problem that I tried to reopen the serial
> port,
> But if I close my app, then I reopen it, the com port become normally.
>
> I use CreateFile() to open serial port, CloseHandle() to close serial
> port.
> Why can I didn't get the same result as application restart.
>
> Any help would be greatly appreciated.
>
> ---------------------------
> wz
>
>

which driver do you use?
serial.sys?

you tried also
PurgeComm (hfile, PURGE_TXABORT | PURGE_RXABORT |PURGE_TXCLEAR
|PURGE_RXCLEAR);



armin.


From: wangzhong on
I solved this problem today.

I am sorry because there is not any relation with COM driver.

The data device of the peer will be timeout if my app can not
give the response in 1 second. It is so important, but it is not
written in the specification.

when the program is restarted, the thread for data display is
very idle, so the thread for COM comunication is very fast to
send the response. While the data is increase, the data display
become slower, the thread for COM comunication is also slower,
It cause timeout in peer.

Thank you very much.


"Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
news:eXdRR833FHA.3244(a)tk2msftngp13.phx.gbl...
> Do you mean you disable and enable driver and that not work ?...
> That stop driver to work and restart with full initialization.
> You did something incorrectly IMHO, try do the same with device manager
( my
> computer->View system info->Hardware->Device manager )
> Arkady
> "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
> news:e6PDfav3FHA.3592(a)TK2MSFTNGP12.phx.gbl...
> > sorry, It did not work.
> >
> > I want to know the difference between the app restart and the com
restart
> > about serial port initializtion
> >
> > ------or------
> >
> > When COM port is opened first in a process, what is done for COM
> > initializtion
> > in Windows kernel ?
> >
> >
> > "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
> > news:O7qk6br2FHA.700(a)TK2MSFTNGP15.phx.gbl...
> >> I will try to do it, thank you very much.
> >>
> >> "Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
> >> news:e5jYeok2FHA.2816(a)tk2msftngp13.phx.gbl...
> >> > Additionally : good one is restart command of devcon
> >> > Arkady
> >> >
> >> > "Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
> >> > news:OCMkFYL2FHA.464(a)TK2MSFTNGP15.phx.gbl...
> >> > > Try to use devcon from DDK to check port status and disable/enable
> >> > > the
> >> > > port
> >> > > Arkady
> >> > >
> >> > > "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
> >> > > news:eQe%23e1G2FHA.2964(a)TK2MSFTNGP09.phx.gbl...
> >> > >> Hello.
> >> > >>
> >> > >> I have written a modem comunication app and got a very strange
> > problem.
> >> > >>
> >> > >> When CE_RXPARITY error is catched by my app, I use
ClearCommError()
> >> > >> to reset this error. but COM access become abnormally since this
> >> > >> connntion.
> >> > >> My app only can get the first telegram from any connection.
> >> > >>
> >> > >> It is failed to repair this problem that I tried to reopen the
> >> > >> serial
> >> > >> port,
> >> > >> But if I close my app, then I reopen it, the com port become
> > normally.
> >> > >>
> >> > >> I use CreateFile() to open serial port, CloseHandle() to close
> > serial
> >> > >> port.
> >> > >> Why can I didn't get the same result as application restart.
> >> > >>
> >> > >> Any help would be greatly appreciated.
> >> > >>
> >> > >> ---------------------------
> >> > >> wz
> >> > >>
> >> > >>
> >> > >
> >> > >
> >> >
> >> >
> >>
> >
>
>

From: Arkady Frenkel on
Oh , that so simple :) solution.
Shame on me , that becayuse I'm working in the company and one of its
controllers ( device we produce ) demand 4.6 msec ( yes , yes ) so I know
such problems :)
Arkady

"wangzhong" <wzhy2000(a)hotmail.com> wrote in message
news:eR2i0fS4FHA.3136(a)TK2MSFTNGP09.phx.gbl...
>I solved this problem today.
>
> I am sorry because there is not any relation with COM driver.
>
> The data device of the peer will be timeout if my app can not
> give the response in 1 second. It is so important, but it is not
> written in the specification.
>
> when the program is restarted, the thread for data display is
> very idle, so the thread for COM comunication is very fast to
> send the response. While the data is increase, the data display
> become slower, the thread for COM comunication is also slower,
> It cause timeout in peer.
>
> Thank you very much.
>
>
> "Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
> news:eXdRR833FHA.3244(a)tk2msftngp13.phx.gbl...
>> Do you mean you disable and enable driver and that not work ?...
>> That stop driver to work and restart with full initialization.
>> You did something incorrectly IMHO, try do the same with device manager
> ( my
>> computer->View system info->Hardware->Device manager )
>> Arkady
>> "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
>> news:e6PDfav3FHA.3592(a)TK2MSFTNGP12.phx.gbl...
>> > sorry, It did not work.
>> >
>> > I want to know the difference between the app restart and the com
> restart
>> > about serial port initializtion
>> >
>> > ------or------
>> >
>> > When COM port is opened first in a process, what is done for COM
>> > initializtion
>> > in Windows kernel ?
>> >
>> >
>> > "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
>> > news:O7qk6br2FHA.700(a)TK2MSFTNGP15.phx.gbl...
>> >> I will try to do it, thank you very much.
>> >>
>> >> "Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
>> >> news:e5jYeok2FHA.2816(a)tk2msftngp13.phx.gbl...
>> >> > Additionally : good one is restart command of devcon
>> >> > Arkady
>> >> >
>> >> > "Arkady Frenkel" <arkadyf(a)hotmailxdotx.com> wrote in message
>> >> > news:OCMkFYL2FHA.464(a)TK2MSFTNGP15.phx.gbl...
>> >> > > Try to use devcon from DDK to check port status and disable/enable
>> >> > > the
>> >> > > port
>> >> > > Arkady
>> >> > >
>> >> > > "wangzhong" <wzhy2000(a)hotmail.com> wrote in message
>> >> > > news:eQe%23e1G2FHA.2964(a)TK2MSFTNGP09.phx.gbl...
>> >> > >> Hello.
>> >> > >>
>> >> > >> I have written a modem comunication app and got a very strange
>> > problem.
>> >> > >>
>> >> > >> When CE_RXPARITY error is catched by my app, I use
> ClearCommError()
>> >> > >> to reset this error. but COM access become abnormally since this
>> >> > >> connntion.
>> >> > >> My app only can get the first telegram from any connection.
>> >> > >>
>> >> > >> It is failed to repair this problem that I tried to reopen the
>> >> > >> serial
>> >> > >> port,
>> >> > >> But if I close my app, then I reopen it, the com port become
>> > normally.
>> >> > >>
>> >> > >> I use CreateFile() to open serial port, CloseHandle() to close
>> > serial
>> >> > >> port.
>> >> > >> Why can I didn't get the same result as application restart.
>> >> > >>
>> >> > >> Any help would be greatly appreciated.
>> >> > >>
>> >> > >> ---------------------------
>> >> > >> wz
>> >> > >>
>> >> > >>
>> >> > >
>> >> > >
>> >> >
>> >> >
>> >>
>> >
>>
>>
>


First  |  Prev  | 
Pages: 1 2
Prev: OpenThread
Next: Matching a volume to a device