Does advanced hmi support multiple pages? When I create an additional form it works but the screen update or comms is much slower on the additional screen.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been playing with that as well, and so far I can't get a second form to work at all unless I actually unload the first one. I intended to have more than one screen in my app, but transitioning between forms is very slow because of unloading one and loading another. I wished to just hide the first one but with the DF1Comm still active I get all kinds of problems. Unloading the first form before loading the next one seems to work ok, if you can tolerate the lag.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am having problems with multiple forms as well with DF1.
A single form works fine.
Multiple forms give me a conflict with DF1 comm.
I am getting the following errors with the DF1 comm.
Right now each form has its own DF1Comm# and I use ( Me.Close ) to clear connections.
Let me know the proper procedure for multiple forms using the DF1Comm?
at form Process Step#2
Locals
+ Me {MfgControl.AdvancedHMI.DF1Comm} MfgControl.AdvancedHMI.DF1Comm
+ e {System.EventArgs} System.EventArgs
+ ex {"Not Acknowledged (NAK)"} System.Exception
Call Stack
> AdvancedHMI.exe!MfgControl.AdvancedHMI.DF1Comm.PollUpdate(Object sender = {Interval = 50}, System.EventArgs e = {System.EventArgs}) Line 554 Basic
i did a test and have two forms, each have got a df1comm1 with the same com port, and each have got a few controls such as basic indicator, digital panel meter etc. The only problem i get is that when i switch to the other form i get this error:
Error in returning data from datareceived
So, what i always do when dealing with multiple forms is to set the DF1Comm1.DisableSubscriptions property of each DF1comm1 to True in design mode, and then toggle them when i want to use that form, obviously toggling the redundant one at the same time. Try that see how you go.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I already tried that.
With three forms, it does not work.
I also set the DF1Comm1.DisableSubscriptions property of each DF1comm1 to True in design mode.
I tried changing them to false both from a seperate main form that called the DF1 forms as well as in the New Sub of each form and true on form close. Neither worked.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
try not using the me.close statement in favour of only disabling the subscriptions when you change forms, that's how i'm doing it and i don't even use me.close when i finally close the last form. perhaps when you use the me.close, there needs to be a time delay as the pc needs to re-open the com port and as you may see when you intially open up a single form it takes a couple of seconds to start subsribing to the controls.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK I did that … did not work.
I tried setting all the forms from the Mainform Public Sub New():
ProcessX.DF1Comm3.DisableSubscriptions = True ( Same as in the forms Default parameter settings )
ProcessX.Show()
Nothing should happen, but I get the Error message from the Mainfrom with no DF1comm :
"Error in returning data from datareceived"
Perhaps you could just post a simple multiform example?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I never actually close any forms. I only Show and Hide:
Form2.Show
Form2.Hide
In order to keep down excessive polling on hidden forms, I add this code to every form:
'*******************************************************************************
'* Stop polling when the form is not visible in order to reduce communications
'*******************************************************************************
Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
If components IsNot Nothing Then
Dim drv As ICommComponent
'*****************************
'* Search for comm components
'*****************************
For i As Integer = 0 To components.Components.Count - 1
If components.Components(i).GetType.GetInterface("ICommComponent") IsNot Nothing Then
drv = components.Components.Item(i)
'* Stop/Start polling based on form visibility
drv.DisableSubscriptions = Not Me.Visible
End If
Next
End If
End Sub
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Does advanced hmi support multiple pages? When I create an additional form it works but the screen update or comms is much slower on the additional screen.
I have been playing with that as well, and so far I can't get a second form to work at all unless I actually unload the first one. I intended to have more than one screen in my app, but transitioning between forms is very slow because of unloading one and loading another. I wished to just hide the first one but with the DF1Comm still active I get all kinds of problems. Unloading the first form before loading the next one seems to work ok, if you can tolerate the lag.
There have been some fixes in the past few months that may resolve these issues.
I am having problems with multiple forms as well with DF1.
A single form works fine.
Multiple forms give me a conflict with DF1 comm.
I am getting the following errors with the DF1 comm.
Right now each form has its own DF1Comm# and I use ( Me.Close ) to clear connections.
Let me know the proper procedure for multiple forms using the DF1Comm?
at form Process Step#2
Locals
+ Me {MfgControl.AdvancedHMI.DF1Comm} MfgControl.AdvancedHMI.DF1Comm
+ e {System.EventArgs} System.EventArgs
+ ex {"Not Acknowledged (NAK)"} System.Exception
Call Stack
> AdvancedHMI.exe!MfgControl.AdvancedHMI.DF1Comm.PollUpdate(Object sender = {Interval = 50}, System.EventArgs e = {System.EventArgs}) Line 554 Basic
DF1Comm.vb
Break pt
m_SynchronizingObject.BeginInvoke(PolledAddressList(i).dlgCallBack, CObj(TempArray))
at form Process Step#3
+ ex {"No Reponse, Check COM Settings"} System.Exception
Bw1sf, did you fix this?
NO, I was waiting for the fixes from arj3090.
i did a test and have two forms, each have got a df1comm1 with the same com port, and each have got a few controls such as basic indicator, digital panel meter etc. The only problem i get is that when i switch to the other form i get this error:
Error in returning data from datareceived
So, what i always do when dealing with multiple forms is to set the DF1Comm1.DisableSubscriptions property of each DF1comm1 to True in design mode, and then toggle them when i want to use that form, obviously toggling the redundant one at the same time. Try that see how you go.
I already tried that.
With three forms, it does not work.
I also set the DF1Comm1.DisableSubscriptions property of each DF1comm1 to True in design mode.
I tried changing them to false both from a seperate main form that called the DF1 forms as well as in the New Sub of each form and true on form close. Neither worked.
Have you got the latest version of advancedhmi?
I am using AdvancedHMIBeta302
Are you using a USB-Serial converter? Just, if you are, sometimes the driver can cause funny problems….
No, it is a standard AB DB9 serial connector.
try not using the me.close statement in favour of only disabling the subscriptions when you change forms, that's how i'm doing it and i don't even use me.close when i finally close the last form. perhaps when you use the me.close, there needs to be a time delay as the pc needs to re-open the com port and as you may see when you intially open up a single form it takes a couple of seconds to start subsribing to the controls.
OK I did that … did not work.
I tried setting all the forms from the Mainform Public Sub New():
ProcessX.DF1Comm3.DisableSubscriptions = True ( Same as in the forms Default parameter settings )
ProcessX.Show()
Nothing should happen, but I get the Error message from the Mainfrom with no DF1comm :
"Error in returning data from datareceived"
Perhaps you could just post a simple multiform example?
I never actually close any forms. I only Show and Hide:
Form2.Show
Form2.Hide
In order to keep down excessive polling on hidden forms, I add this code to every form:
'*******************************************************************************
'* Stop polling when the form is not visible in order to reduce communications
'*******************************************************************************
Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
If components IsNot Nothing Then
Dim drv As ICommComponent
'*****************************
'* Search for comm components
'*****************************
For i As Integer = 0 To components.Components.Count - 1
If components.Components(i).GetType.GetInterface("ICommComponent") IsNot Nothing Then
drv = components.Components.Item(i)
'* Stop/Start polling based on form visibility
drv.DisableSubscriptions = Not Me.Visible
End If
Next
End If
End Sub
OK, that did it.
All forms are good now.
Thanks