AdvancedHMI Software
General Category => Support Questions => Topic started by: scott.clark on January 23, 2015, 12:42:14 PM
-
I just updated an application from version 3.97 to v3.97d
In my MainForm.vb, I have a "EthernetIPforCLX_MainForm" instance of EthernetIPforCLX running. From the MainForm.vb I open another form, frmPLCManualMode.vb that has a "EthernetIPforCLXCom_frmPLCManualMode" instance of EthernetIPforCLX. Both forms update the PLC objects at this point. I then close this form with the following code:
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
EthernetIPforCLXCom_frmPLCManualMode.CloseConnection()
EthernetIPforCLXCom_frmPLCManualMode.Dispose()
Me.Close()
End Sub
This closes the frmPLCManualMode.vb form causes the "EthernetIPforCLX_MainForm" instance of EthernetIPforCLX to stop updating.
I also tried commented out the the close and dispose lines from the above code, but same result.
This worked before in in an older version of AdvancedHMI. Any suggestions?
Thanks!
-
In the main form code is an event handler for VisibleChanged. Comment out that one line and see what effect it has
-
In this case, the CloseConnection and Dispose calls are not necessary, it will be done automatically after the form is closed.
A better practice is to hide the form so when it is reopened, it will come up faster. If you include the VisibleChanged event handler as on the MainForm, then when form is hidden, it will pause the communications for that form.
-
Thank you for the suggestions, works very nice.