cdholding image

comm32 home
comm32 forum
buy comm32

Introduction
Install Comm32
Why Not MsComm?

Properties
   .Break
   .CDHolding
   .CommEvent
   .CommPort
   .CTSHolding
   .DSRHolding
   .DTREnable
   .EOFEnable
   .Handshaking
   .InBufferCount
   .InBufferSize
   .Input
   .InputLen
   .InputMode
   .NullDiscard
   .OutBufferCount
   .OutBufferSize
   .OutPut
   .ParityReplace
   .PortOpen
   .RThreshold
   .RTSEnable
   .Settings
   .STHreshold


Comm32 Properties
   .DeviceName
   .EOFChar
   .EvtChar
   .EvtCharEnable
   .OutPutEx
   .OutPutMode
   .ParallelEnable
   .TxTimeout

Comm32 Functions
   .getByte

   .GetPortStatus
   .InstalledDrivers
   .putByte
   .PortExists
   .ReadBytes
   .ReadString
   .WriteBytes
   .WriteString

OnComm Event
Hardware/Cables etc

CommEvent

Retrieves a numerical event code indicating the most recent communications event or error.

Not Available at Design time. Read Only at RunTime

MSComm32 and Comm32 have Identical Behavior.

  Syntax value = object.CommEvent
     
  object Name of the communications control.
  value A numeric expression containing the numeric event code being one of the following
       
    1 = comEvSend
There are fewer than Sthreshold number of characters in the transmit buffer.
    2 = comEvReceive
There are more than Rthreshold number of characters in the receive buffer.
    3 = comEvCTS
Change in Clear To Send line.
 
    4 = comEvDSR
Change in Data Set Ready line. This event is only fired when DSR changes from 1 to 0.
    5 = comEvCD
Change in Carrier Detect line.
 
         6 = comEvRing
Ring detected. Some hardware may not support this event.
    7 = comEvEOF
End Of File character received.
 
       
    101 = comEvEvtChar See Comm32 evtChar
       
     
    1001 = comEventBreak
A Break signal was received.
 
    1002 = comEventFrame
The hardware detected a framing error.
 
    1006 = comEventOverrun
The hardware could not receive data fast enough and some was lost
    1007 = comEvEOF
End Of File character received.
 
    1008 = comEventRxOver
Receive Buffer Overflow. There is no room in the receive buffer. Some data was lost
    1009 = comEventRxParity
Parity Error. The hardware detected a parity error.
    1010 = comEventTxFull
Transmit Buffer Full. The transmit buffer was full while trying to queue a character.
    1011 = comEventDCB
An error occurred while setting up the Windows Com driver.
          Example  
 

If object.CommEvent > 1000 then
      MsgBox ("A communications ERROR occurred")
End If

   

Remarks:

When using Event driven communications you would generally respond to the OnComm event and then interrogate the CommEvent property to decide what the cause of the OnComm event was. (The CommEvent property contains the code/reason for the raising of the OnComm event)

 

 

 

 

Copyright (c) 2010 Axis Controls Ltd