Tried V399d as it is, without changing any code, and it appears that both ModbusTCP driver events work fine.
There seems to be a new event "ConnectionClosed", present since version 399b.
Also, while using com0com paired ports for testing AHMI with ModbusRTU driver on COM11 and with ModRSSim as slave on COM1, here is what happens:
1) ModbusRTU driver seems to be considering connection established as soon as the application is started (probably after opening COM port and regardless of whether the slave is connected on the other end - the 1st attached picture shows this).
2) Once the slave was connected and then disconnected, the driver noticed the latter and raised the CommError event
3) After the slave was connected again, the driver didn't seem to have noticed that to raise the ConnectionEstablished event (the 2nd attached picture shows this)
This was a simple test with 4 BasicIndicator controls placed on the MainForm, 2 controls per driver - square shaped responding to driver events through code and round shaped responding to 00001 address in the PLCAddressSelect2 field (see the attached picture).
Here is the code that was used (the same pattern was used for either driver):
Private Sub ModbusRTUCom1_ComError(ByVal sender As Object, ByVal e As Drivers.Common.PlcComEventArgs) Handles ModbusRTUCom1.ComError
Me.BasicIndicator1.SelectColor2 = False
Me.BasicIndicator1.SelectColor3 = True
End Sub
Private Sub ModbusRTUCom1_ConnectionEstablished(ByVal sender As Object, ByVal e As System.EventArgs) Handles ModbusRTUCom1.ConnectionEstablished
Me.BasicIndicator1.SelectColor2 = True
Me.BasicIndicator1.SelectColor3 = False
End Sub
Private Sub ModbusTCPCom1_ComError(ByVal sender As Object, ByVal e As Drivers.Common.PlcComEventArgs) Handles ModbusTCPCom1.ComError
Me.BasicIndicator3.SelectColor2 = False
Me.BasicIndicator3.SelectColor3 = True
End Sub
Private Sub ModbusTCPCom1_ConnectionEstablished(ByVal sender As Object, ByVal e As System.EventArgs) Handles ModbusTCPCom1.ConnectionEstablished
Me.BasicIndicator3.SelectColor2 = True
Me.BasicIndicator3.SelectColor3 = False
End Sub
It might be possible that the ModbusRTU driver needed more time to recognize all the events (which wasn't the case with ModbusTCP driver).