[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: CM11 Status Request (C# Language)



I'm rather dull when it comes to C# but my VB code (using the MSComm32.OCX
control) has been working for several years.

  MSComm1.RThreshold = 0               'disable comm events
  MSComm1.Output = Chr(&H8B)           'status request
  start = GetTickCount
  Do
    CM11A_Status = CM11A_Status & MSComm1.Input
    If GetTickCount - start > 50 Then
      MsgBox "Timeout waiting for CM11A Status"
      Exit Do
    End If
  Loop Until Len(CM11A_Status) > 13
  'process here
  MSComm1.RThreshold = 1               'enable comm events

At 4800bps it takes about 28mS for 14 bytes.

"Quina" <carias.joao@xxxxxxxxx> wrote:

>Hi there,
>
>I'm having trouble to get the CM11 status request. It took me a long
>time to figure out how to comunicate with the CM11 (e.g. to turn On a
>device...) but I can do it now.
>
>Now the problem seem to be the status requesting issue. When I send the
>code 0x8B to the device, it freezes or start to have a strange
>behavior.
>
>I'm comunicating like this:
>
>send...
>[PC] 0x8b >> [CM11]
>
>try to recive...
>
>14 bytes
>
>...but it's behavior is strange and blocks...
>
>What shoul I do?
>
>Thank's in advance.
>
>Quina


http://davehouston.net
http://tech.groups.yahoo.com/group/roZetta/
roZetta-subscribe@xxxxxxxxxxxxxxx


comp.home.automation Main Index | comp.home.automation Thread Index | comp.home.automation Home | Archives Home