Menu

Multiple port initialization with Com0Com

Help
Dan
2009-08-08
2013-05-20
  • Dan

    Dan - 2009-08-08

    Hello,
    I am currently using Com0com 2.2.0.0.  I captured port traces using PortMon of an application connecting to COM1 with a bar code scanner and a Com0Com emulated port COM4.

    With the application connected to COM1, the com port appears to be initialized once:

    0  0.00000000  Hub.exe  IRP_MJ_CREATE  Serial0  Options: Open
    0  0.00005615  SUCCESS 
    1  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  Serial0  Mask: RXCHAR
    1  0.00000866  SUCCESS 
    2  0.00000000  Hub.exe  IOCTL_SERIAL_SET_TIMEOUTS  Serial0  RI:25 RM:0 RC:0 WM:0 WC:0
    2  0.00000196  SUCCESS 
    3  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  Serial0 
    3  0.00000223  SUCCESS 
    4  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  Serial0 
    4  0.00000223  SUCCESS 
    5  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  Serial0 
    5  0.00000196  SUCCESS 
    6  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  Serial0 
    6  0.00000196  SUCCESS 
    7  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  Serial0 
    7  0.00000168  SUCCESS 
    8  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  Serial0 
    8  0.00000168  SUCCESS 
    9  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  Serial0 
    9  0.00000196  SUCCESS 
    10  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  Serial0 
    10  0.00000168  SUCCESS 
    11  0.00000000  Hub.exe  IOCTL_SERIAL_SET_BAUD_RATE  Serial0  Rate: 9600
    11  0.00000922  SUCCESS 
    12  0.00000000  Hub.exe  IOCTL_SERIAL_SET_RTS  Serial0 
    12  0.00000503  SUCCESS 
    13  0.00000000  Hub.exe  IOCTL_SERIAL_SET_DTR  Serial0 
    13  0.00000531  SUCCESS 
    14  0.00000000  Hub.exe  IOCTL_SERIAL_SET_LINE_CONTROL  Serial0  StopBits: 1 Parity: NONE WordLength: 8
    14  0.00000363  SUCCESS 
    15  0.00000000  Hub.exe  IOCTL_SERIAL_SET_CHAR  Serial0  EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
    15  0.00000196  SUCCESS 
    16  0.00000000  Hub.exe  IOCTL_SERIAL_SET_HANDFLOW  Serial0  Shake:1 Replace:40 XonLimit:2048 XoffLimit:512
    16  0.00000391  SUCCESS 
    17  0.00000000  Hub.exe  IOCTL_SERIAL_WAIT_ON_MASK  Serial0 
    17  13.49089368  SUCCESS 

    With the application attached to the Com0com emulated port COM4, the application appears to be initialized a total of 6 times:

    0  0.00000000  Hub.exe  IRP_MJ_CREATE  com0com20  Options: Open
    0  0.00000786  SUCCESS 
    1  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask: RXCHAR
    1  0.00000265  SUCCESS 
    2  0.00000000  Hub.exe  IOCTL_SERIAL_SET_TIMEOUTS  com0com20  RI:25 RM:0 RC:0 WM:0 WC:0
    2  0.00000097  SUCCESS 
    3  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  com0com20 
    3  0.00000072  SUCCESS 
    4  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  com0com20 
    4  0.00000072  SUCCESS 
    5  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  com0com20 
    5  0.00000057  SUCCESS 
    6  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  com0com20 
    6  0.00000064  SUCCESS 
    7  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  com0com20 
    7  0.00000062  SUCCESS 
    8  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  com0com20 
    8  0.00000061  SUCCESS 
    9  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  com0com20 
    9  0.00000059  SUCCESS 
    10  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  com0com20 
    10  0.00000059  SUCCESS 
    11  0.00000000  Hub.exe  IOCTL_SERIAL_SET_BAUD_RATE  com0com20  Rate: 9600
    11  0.00000076  SUCCESS 
    12  0.00000000  Hub.exe  IOCTL_SERIAL_SET_RTS  com0com20 
    12  0.00000071  SUCCESS 
    13  0.00000000  Hub.exe  IOCTL_SERIAL_SET_DTR  com0com20 
    13  0.00000068  SUCCESS 
    14  0.00000000  Hub.exe  IOCTL_SERIAL_SET_LINE_CONTROL  com0com20  StopBits: 1 Parity: NONE WordLength: 8
    14  0.00000081  SUCCESS 
    15  0.00000000  Hub.exe  IOCTL_SERIAL_SET_CHAR  com0com20  EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
    15  0.00000060  SUCCESS 
    16  0.00000000  Hub.exe  IOCTL_SERIAL_SET_HANDFLOW  com0com20  Shake:1 Replace:40 XonLimit:2048 XoffLimit:512
    16  0.00000122  SUCCESS 
    17  0.00000000  Hub.exe  IOCTL_SERIAL_WAIT_ON_MASK  com0com20 
    18  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    17  1.71351115  SUCCESS 
    18  0.00001357  SUCCESS 
    19  0.00000000  Hub.exe  IOCTL_SERIAL_PURGE  com0com20  Purge: RXCLEAR
    19  0.00000973  SUCCESS 
    20  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    20  0.00000400  SUCCESS 
    21  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask: RXCHAR
    21  0.00000155  SUCCESS 
    22  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    22  0.00000080  SUCCESS 
    23  0.00000000  Hub.exe  IRP_MJ_CLEANUP  com0com20 
    23  0.00000111  SUCCESS 
    24  0.00000000  Hub.exe  IRP_MJ_CLOSE  com0com20 
    24  0.00000599  SUCCESS 
    25  0.00000000  Hub.exe  IRP_MJ_CREATE  com0com20  Options: Open
    25  0.00000970  SUCCESS 
    26  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask: RXCHAR
    26  0.00000255  SUCCESS 
    27  0.00000000  Hub.exe  IOCTL_SERIAL_SET_TIMEOUTS  com0com20  RI:25 RM:0 RC:0 WM:0 WC:0
    27  0.00000117  SUCCESS 
    28  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  com0com20 
    28  0.00000082  SUCCESS 
    29  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  com0com20 
    29  0.00000068  SUCCESS 
    30  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  com0com20 
    30  0.00000061  SUCCESS 
    31  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  com0com20 
    31  0.00000069  SUCCESS 
    32  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  com0com20 
    32  0.00000070  SUCCESS 
    33  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  com0com20 
    33  0.00000067  SUCCESS 
    34  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  com0com20 
    34  0.00000065  SUCCESS 
    35  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  com0com20 
    35  0.00000060  SUCCESS 
    36  0.00000000  Hub.exe  IOCTL_SERIAL_SET_BAUD_RATE  com0com20  Rate: 9600
    36  0.00000100  SUCCESS 
    37  0.00000000  Hub.exe  IOCTL_SERIAL_SET_RTS  com0com20 
    37  0.00000075  SUCCESS 
    38  0.00000000  Hub.exe  IOCTL_SERIAL_SET_DTR  com0com20 
    38  0.00000070  SUCCESS 
    39  0.00000000  Hub.exe  IOCTL_SERIAL_SET_LINE_CONTROL  com0com20  StopBits: 1 Parity: NONE WordLength: 8
    39  0.00000099  SUCCESS 
    40  0.00000000  Hub.exe  IOCTL_SERIAL_SET_CHAR  com0com20  EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
    40  0.00000072  SUCCESS 
    41  0.00000000  Hub.exe  IOCTL_SERIAL_SET_HANDFLOW  com0com20  Shake:1 Replace:40 XonLimit:2048 XoffLimit:512
    41  0.00000128  SUCCESS 
    42  0.00000000  Hub.exe  IOCTL_SERIAL_WAIT_ON_MASK  com0com20 
    43  0.00000000  Hub.exe  IOCTL_SERIAL_PURGE  com0com20  Purge: RXCLEAR
    43  0.00000672  SUCCESS 
    44  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    42  24.09154859  SUCCESS 
    44  0.00001341  SUCCESS 
    45  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask: RXCHAR
    45  0.00000090  SUCCESS 
    46  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    46  0.00000120  SUCCESS 
    47  0.00000000  Hub.exe  IRP_MJ_CLEANUP  com0com20 
    47  0.00000128  SUCCESS 
    48  0.00000000  Hub.exe  IRP_MJ_CLOSE  com0com20 
    48  0.00000964  SUCCESS 
    49  0.00000000  Hub.exe  IRP_MJ_CREATE  com0com20  Options: Open
    49  0.00000812  SUCCESS 
    50  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask: RXCHAR
    50  0.00000214  SUCCESS 
    51  0.00000000  Hub.exe  IOCTL_SERIAL_SET_TIMEOUTS  com0com20  RI:25 RM:0 RC:0 WM:0 WC:0
    51  0.00000088  SUCCESS 
    52  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  com0com20 
    52  0.00000070  SUCCESS 
    53  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  com0com20 
    53  0.00000065  SUCCESS 
    54  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  com0com20 
    54  0.00000066  SUCCESS 
    55  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  com0com20 
    55  0.00000058  SUCCESS 
    56  0.00000000  Hub.exe  IOCTL_SERIAL_GET_BAUD_RATE  com0com20 
    56  0.00000058  SUCCESS 
    57  0.00000000  Hub.exe  IOCTL_SERIAL_GET_LINE_CONTROL  com0com20 
    57  0.00000060  SUCCESS 
    58  0.00000000  Hub.exe  IOCTL_SERIAL_GET_CHARS  com0com20 
    58  0.00000066  SUCCESS 
    59  0.00000000  Hub.exe  IOCTL_SERIAL_GET_HANDFLOW  com0com20 
    59  0.00000058  SUCCESS 
    60  0.00000000  Hub.exe  IOCTL_SERIAL_SET_BAUD_RATE  com0com20  Rate: 9600
    60  0.00000071  SUCCESS 
    61  0.00000000  Hub.exe  IOCTL_SERIAL_SET_RTS  com0com20 
    61  0.00000069  SUCCESS 
    62  0.00000000  Hub.exe  IOCTL_SERIAL_SET_DTR  com0com20 
    62  0.00000069  SUCCESS 
    63  0.00000000  Hub.exe  IOCTL_SERIAL_SET_LINE_CONTROL  com0com20  StopBits: 1 Parity: NONE WordLength: 8
    63  0.00000095  SUCCESS 
    64  0.00000000  Hub.exe  IOCTL_SERIAL_SET_CHAR  com0com20  EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
    64  0.00000060  SUCCESS 
    65  0.00000000  Hub.exe  IOCTL_SERIAL_SET_HANDFLOW  com0com20  Shake:1 Replace:40 XonLimit:2048 XoffLimit:512
    65  0.00000115  SUCCESS 
    66  0.00000000  Hub.exe  IOCTL_SERIAL_WAIT_ON_MASK  com0com20 
    67  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    66  0.12005896  SUCCESS 
    67  0.00001485  SUCCESS 
    68  0.00000000  Hub.exe  IOCTL_SERIAL_PURGE  com0com20  Purge: RXCLEAR
    68  0.00000233  SUCCESS 
    69  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    69  0.00000107  SUCCESS 
    70  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask: RXCHAR
    70  0.00000122  SUCCESS 
    71  0.00000000  Hub.exe  IOCTL_SERIAL_SET_WAIT_MASK  com0com20  Mask:
    71  0.00000077  SUCCESS 
    72  0.00000000  Hub.exe  IRP_MJ_CLEANUP  com0com20 
    72  0.00000106  SUCCESS 
    73  0.00000000  Hub.exe  IRP_MJ_CLOSE  com0com20 
    73  0.00000502  SUCCESS 

    Any suggestions on what would cause the application to initialize the port multiple times with Com0Com?  How could I modify the Com0Com settings to appear more like the actual hardware port to this application?

    Thank you,
    Dan

     
    • Vyacheslav Frolov

      > Any suggestions on what would cause the application to initialize the port multiple
      > times with Com0Com?

      There is data arriving to port COM4 from paired port while initialization.

      > How could I modify the Com0Com settings to appear more
      > like the actual hardware port to this application?

            command> change CNCB0 EmuOverrun=yes,EmuBR=yes
            command> change CNCA0 EmuOverrun=yes,EmuBR=yes

       
    • Dan

      Dan - 2009-08-12

      Thank you!  Purging the com port prior to the application connecting to COM4 and setting EmuOverrun=yes and EmuBR=yes fixes the issue.

       

Log in to post a comment.