Consulting

Results 1 to 2 of 2

Thread: Mscomm32 (using Netcomm) reading issue with USB to serial comport

  1. #1

    Mscomm32 (using Netcomm) reading issue with USB to serial comport

    Hi everyone

    It is my first post. So, if anything is unclear, please, kindly notice.
    I am using Excel 2007 with VB6.5 programming a small macro to communicate with devices through 2 Com ports.
    COM1: PC build-in RS232 serial communication Port
    COM2: Prolific USB-to-serial Comm Port
    I use NetcommOCX form to build the macro.
    It works(read/write) fine with COM1.
    But It cannot read from COM2.
    The macro can still send data/command to device through COM2, but get Run-time error "8020" when reading feedback data from it.

    I also tried to enable/disable RTS and DTR flow control but still cannot receive data from COM2.
    All other settings are standard 9600, no parity, 8, 1,

    Does any one have the same issue before?
    Please, help. Thanks

    Regards,
    Ernie

  2. #2
    Here is code of reading sub
    Public Function ReadMSG() As String

    If UserForm1.UARTComm1.CommEvent = 2 And UserForm1.UARTComm1.InBufferCount <> 0 Then
    Range("E1") = UserForm1.UARTComm1.CommEvent
    ComPortMsg = UserForm1.UARTComm1.InputData
    Range("C4") = ComPortMsg
    Else
    ComPortMsg = "No Response"
    End If

    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •