PC-Dmis 2010 MR3 Object Library | Send comments on this topic. | See Object Hierarchy Chart
OpenCommConnection Method
See Also

Collapse All Expand All

port
  The comm port to open. Required.

baud
  The baud rate at which to communicate with the port. Optiona. Default is PCD_BAUD_9600.

parity
  Optional. Default is PCD_NOPARITY.

Data
  Data Bits. Optional. Default is PCD_DATA8.

stop
  Stop bits. Optional. Default is PCD_ONESTOPBIT.

flow
  Flow control. Optional. Default is PCD_RTSCTS.

# Description

Opens a communication port for reading and writing Opens a connection to the specified comm port.

# Syntax

Visual Basic

    Public Function OpenCommConnection( _
       ByVal port As Long, _
       ByVal baud As PCDBAUD, _
       ByVal parity As PCDPARITY, _
       ByVal Data As PCDDATABITS, _
       ByVal stop As PCDSTOPBITS, _
       ByVal flow As PCDHANDSHAKE _
    ) As Long

# Parameters

port
  The comm port to open. Required.
baud

  Value | Description
  --- | ---
  PCD_BAUD_110 |
  PCD_BAUD_300 |
  PCD_BAUD_600 |
  PCD_BAUD_1200 |
  PCD_BAUD_2400 |
  PCD_BAUD_4800 |
  PCD_BAUD_9600 |
  PCD_BAUD_14400 |
  PCD_BAUD_19200 |
  PCD_BAUD_38400 |
  PCD_BAUD_56000 |
  PCD_BAUD_128000 |
  PCD_BAUD_256000 |

  The baud rate at which to communicate with the port. Optiona. Default is PCD_BAUD_9600.
parity

  Value | Description
  --- | ---
  PCD_NOPARITY |
  PCD_EVENPARITY |
  PCD_ODDPARITY |
  PCD_MARKPARITY |
  PCD_SPACEPARITY |

  Optional. Default is PCD_NOPARITY.
Data

  Value | Description
  --- | ---
  PCD_DATA8 |
  PCD_DATA7 |

  Data Bits. Optional. Default is PCD_DATA8.
stop

  Value | Description
  --- | ---
  PCD_ONESTOPBIT |
  PCD_ONE5STOPBITS |
  PCD_TWOSTOPBITS |

  Stop bits. Optional. Default is PCD_ONESTOPBIT.
flow

  Value | Description
  --- | ---
  PCD_DTRDSR |
  PCD_RTSCTS |
  PCD_XONXOFF |

  Flow control. Optional. Default is PCD_RTSCTS.

# Return Type

Long value. 0 if successful, -1 on error.

# See Also

OldBasic Object

© Wilcox Associates, Inc. All Rights Reserved.

© 2010 All Rights Reserved.