Re: MSComm control array

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




"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


.



Relevant Pages

  • MSComm control array
    ... array every 500 milliseconds. ... On each serial port is connected a plc and the ...
    (microsoft.public.vb.general.discussion)
  • Re: Threaded access to serial port under Windows
    ... the server gathered data from a plc connected through ... a serial port. ... On that system clients connect to the ...
    (comp.lang.tcl)
  • Re: read PLC register value into pc???
    ... Go into some detail for PLC programming, ... is there a command in PLC to send a register value to serial port. ...
    (microsoft.public.vb.general.discussion)
  • Software interrupts; where to start
    ... via simple commands relayed from the serial port of the server. ... array and polling the memcached server comparing the values against an array ... This trigger should be ... integrated within the kernel in some way would be even better. ...
    (freebsd-hackers)
  • Re: serial port Writefile: sometimes 998 ERROR_NOACCESS
    ... Is there an array of threads handling this? ...  And are they valid if the thread terminates? ... for 12 serial port writer threads. ... reason), but instead, I would provide the CWinThread* object to the thread that needs to ...
    (microsoft.public.vc.mfc)