Re: MSComm control array
- From: "Chris Kusmierz" <ckusmierz(at)verizon(dot)net>
- Date: Fri, 15 Apr 2005 09:37:54 -0400
"Theo" <hgfhfghf@xxxxxxxxxxx> wrote in message
news:ucP%23okbQFHA.1176@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I am working on a project where a timer loops through an mscomm control
> array every 500 milliseconds. On each serial port is connected a plc and
the
> software is querying the plc status by sending a special character to the
> serial port and then enables an other 400 millisecond timer (this is
> probably the timeout limit) that reads the port for incoming data. This
> whole cycle takes about 16 seconds (for 16 plc) to complete.
>
>
>
> The new scenario is that the plc makes a request to the pc and the pc
> replies with some data. The problem is the delay that may occur before the
> pc is aware of this request (which will not happen until the loop goes
back
> to that plc to read the serial port). I thought to use the OnComm event to
> capture the incoming request but for some reason the event is not fired at
> all! I looked through the code but i could not see any obvious reasons why
> that should happen. I also simulated the control array in a new project
and
> the event works fine.
>
>
>
> What can it be that disables the OnComm event? (if it can be disabled...)
>
> Shouldn't the event be fired even if the incoming data is read instantly
> from the port?
>
>
>
> Unfortunately i am not allowed to make any changes to the program apart
from
> the necessary parts so there is no chance to rewrite or optimise it in any
> way. I can only add new bits of code to achieve this extra functionality.
>
>
>
> Any advice on this problem or the project in general is much appreciated.
>
>
>
> Kind regards,
>
> Theo
>
>
Setting the RThreshold value to 0 will effectively diasable the OnComm
event.
HTH
Chris A. Kusmierz
.
- References:
- MSComm control array
- From: Theo
- MSComm control array
- Prev by Date: Re: ODBC connections crashing
- Next by Date: Re: charting data
- Previous by thread: MSComm control array
- Next by thread: Re: MSComm control array
- Index(es):
Relevant Pages
|