SComm32 Communications OCX
Properties/Methods . Break . CDHolding . Commevent . CommName . CommPort . CTSHolding . DSRHolding . DTREnable . EOFChar . EOFEnable . EvtChar . EvtCharEnable . Handshaking . InBufferCount . InBufferSize . Input . InputLen . InputMode . NullDiscard . OutBufferCount . OutBufferSize . Output . OverlappedIO . ParityReplace . PortOpen . Read . RThreshold . RTSEnable . Settings . SThreshold OnComm Event Hardware/Cables etc Loopback Test Plug
PortOpen
Sets or Retrieves the state (open or closed) of the serial port.
MSComm32 and SComm32 have the same syntax and functionality.
SComm1.PortOpen = value
value:-
A boolean expression indicating whether the port is open or closed
Example:-
SComm1.PortOpen = True
If SComm1.PortOpen = True MsgBox ("Port is Open) Else MsbBox ("Port is Closed") End If
Remarks
If you attempt to open a port that does not exist or a port that is already open then a trapable runtime error occurs.