AdvancedHMI Software
General Category => Support Questions => Topic started by: Morgan on May 10, 2016, 10:55:25 AM
-
The ValueChanged event is triggering constantly event though the BasicLabel value has not changed. The PollRate seems to have no effect.
The TextChanged event is working properly and only triggers when the value has changed.
-
I think you need to specify which driver you are on.
-
I tried this using version 3.99e and a Modbus driver. This is the code I used:
Private Sub BasicLabel1_ValueChanged(sender As Object, e As EventArgs) Handles BasicLabel1.ValueChanged
MsgBox("Event Fired - " & Now)
End Sub
I was only getting 1 message box per change of value.
-
I am using the EthernetIPforCLXCom driver. See screen shot
-
What version of AdvancedHMI are you using?
-
V399e
I have the poll rate set to 6000
The PLC is a CompactLogix and it is in the program mode, just to make sure the value would not change.
-
Can you post your code of your event handler and I will setup the same to try to replicate.
-
Attached is the Form
The basic label is linked to a bit address in the PLC
The BooleanDisplay is set to On/Off
The ValuePrefix is the tag name
-
Here is an example with a bit address that is off
-
I don't have access to CompactLogix PLC so I tried this with EthernetIPforSLCMicroCom1 driver.
The only way I can replicate constant event firing is if I change MyBase.Text to m_Value inside the BasicLabel.vb / UpdateText() sub in the following If statement:
'* True/False comes from driver, change if BooleanDisplay is different 31-DEC-11
If (m_Value = "True" Or m_Value = "False") And m_BooleanDisplay <> BooleanDisplayOption.TrueFalse Then
If m_Value = "True" Then
If m_BooleanDisplay = BooleanDisplayOption.OnOff Then m_Value = "On" 'MyBase.Text replaced with m_Value
If m_BooleanDisplay = BooleanDisplayOption.YesNo Then m_Value = "Yes" 'MyBase.Text replaced with m_Value
Else
If m_BooleanDisplay = BooleanDisplayOption.OnOff Then m_Value = "Off" 'MyBase.Text replaced with m_Value
If m_BooleanDisplay = BooleanDisplayOption.YesNo Then m_Value = "No" 'MyBase.Text replaced with m_Value
End If
'* 24-APR-16 Ver 3.99e
Return
End If
This is normal for this changed code since m_Value is changed back to True/False the next time driver polls the PLC.
With unchanged code I get normal behavior.
Morgan, if you set BooleanDisplay back to TrueFalse do you still get the same event firing?
-
I've been unable to replicate this either. I posted the application I created for the test. You can download the EventFireTest solution from here:
https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects
Be sure to build the solution before opening any form in design view. Change the IPAddress of the CLX driver and run this test app, then let us know your results.
-
Sorry, this was my fault.
I began the project with version V399d. There was a problem with the control in that it always returned True/False regardless of the BooleanDisplay property. I solved the problem by changing the MyBase.text to m_Value in the "If m_Value = "True" Then ... Else ... End If". I had also added some other choices. When the v399e came I replaced the control with the one I modified.
-
The problem with the 399e version is that the Prefix and Suffix properties do not work. The "Return" statement that was add ('* 24-APR-16 Ver 3.99e) bypasses the prefix and suffix.
-
This problem recently discovered and a fix was made that will appear in version 3.99f