VaComm.Close() Program Freezes

Good day,
I have been using the VaComm component for many years, everything is always ok.
Currently I have a problem with one device where the COM port is virtual from USB.
I created a separate simple application (Delphi 7), VaComm1, Button1 - Connect, Button2 - Disconnect.
The VaComm1.Close () command blocks the entire application, it cannot be terminated via the task manager.

  • I usually use USB <-> RS232 (maybe only another manufacturer)
  • I do not send or indirect anything after opening the port
  • other devices, other ports do not behave this way
  • created a similar application in Visual Studio 2019. I will open the COM port, write the text, close it - everything is OK.
  • using foreign applications (Hercules SETUP utility | HW-group.com) - https://www.hw-group.com/files/styles/large/public/swapplication/5462- hercules-setup-utility / anothersterminal19b.png? itok = bVr8wN0l
  • I also tried VaComm1.PurgeReadWrite before closing
  • Read and write buffers are empty
  • I purchased and updated to the latest version. Same behavior.
  • when opening the data sending port it works, I just deleted it all. I am not able to close the port with or without communication.

thanks for support

Zdenek

Not sure what is causing this.
Are you executing any other code after calling .Close()? What is "Disconnect" ? Does this mean you physically disconnect the USB?

Thank you for your response.
procedure TForm1.Button1Click (Sender: TObject);
begin
VaComm1.Open;
end;

procedure TForm1.Button2Click (Sender: TObject);
begin
VaComm1.Close;
end;

Nothing else. I start the application, click on Button1 and then on Button2. The application is frozen and cannot be terminated.

Further information:

  • disconnect here I mean .Close (). I'm not dealing with anomalies with USB disconnection ...
  • it is a POS device and the virtual COM port (in this case COM8) is a printer.
  • the printer transmits CTS, DSR status
  • on the same device another (non-virtual) COM (1,2,3). Open () /. Close () is ok. No device is connected to COM1,2,3.
  • The device is also available via TeamViewer if there is interest
  • I found (my) very old application with VaComm component, which has no problem with .Open () /. Close ().
    I will now translate this application with VaComm version 2.0.2.0 or 2.2.0.1 and the application will start freezing.
    The old * .dfm does not contain an info version of the component, so I don't know when this behavior started.
    Old * .dfm
    object VaComm1: TVaComm
    Baudrate = br19200
    FlowControl.OutCtsFlow = False
    FlowControl.OutDsrFlow = False
    FlowControl.ControlDtr = dtrDisabled
    FlowControl.ControlRts = rtsEnabled
    FlowControl.XonXoffOut = False
    FlowControl.XonXoffIn = False
    FlowControl.DsrSensitivity = False
    FlowControl.TxContinueOnXoff = False
    DeviceName = '\. \ COM% d'
    MonitorEvents = [ceCts, ceError, ceRxChar, ceTxEmpty]
    Buffers.WriteSize = 12072
    OnCts = VaComm1Cts
    OnRxChar = VaComm1RxChar
    Left = 208
    Top = 16
    end

New * .dfm
object VaComm1: TVaComm
Baudrate = br19200
FlowControl.OutCtsFlow = False
FlowControl.OutDsrFlow = False
FlowControl.ControlDtr = dtrDisabled
FlowControl.ControlRts = rtsEnabled
FlowControl.XonXoffOut = False
FlowControl.XonXoffIn = False
FlowControl.DsrSensitivity = False
FlowControl.TxContinueOnXoff = False
DeviceName = '\. \ COM% d'
MonitorEvents = [ceCts, ceError, ceRxChar, ceTxEmpty]
Buffers.WriteSize = 12072
SettingsStore.RegRoot = rrCURRENTUSER
SettingsStore.Location = slINIFile
OnCts = VaComm1Cts
OnRxChar = VaComm1RxChar
Version = '2.2.0.1'
Left = 208
Top = 16
end

Have a nice day
Zdenek

1 Like

I could not reproduce this. Test project attached.
Project1.zip (4.8 KB)