AdvancedHMI Software
General Category => Open Discussion => Topic started by: DavidSr on March 29, 2022, 07:08:06 AM
-
Can this code or something else be added to the Chart with Logging to hide the chart while still allowing it to function?
'*****************************************
'* Property - Address in PLC to Link to
'*****************************************
Private InvertVisible As Boolean
Private m_PLCAddressVisible As String = ""
<Browsable(True), Category("PLC Properties"), Description("PLCAddress to control the LED visibility."), DefaultValue("")> _
Public Property PLCAddressVisible() As String
Get
Return m_PLCAddressVisible
End Get
Set(ByVal value As String)
If m_PLCAddressVisible <> value Then
m_PLCAddressVisible = value
'* When address is changed, re-subscribe to new address
SubscribeToCommDriver()
End If
End Set
End Property
-
The "Auto property" feature works with only one line of code needed
Public Property PLCAddressVisible() As String
-
Archie I have playing with this off and and on all day but this just isn't my bailiwick so I have not figured out where to put that code. Everything I tried produced errors I did not know what to do with.
-
I had an extra set of parentheses. The best place to put it is at line 170
'*****************************************
'* Property - Address in PLC to Link to
'*****************************************
Private m_PLCAddressValueItems As New System.Collections.ObjectModel.ObservableCollection(Of MfgControl.AdvancedHMI.Drivers.PLCAddressItemEx)
<System.ComponentModel.BrowsableAttribute(True), System.ComponentModel.EditorAttribute(GetType(PLCAddressItemEditor), GetType(System.Drawing.Design.UITypeEditor))>
<System.ComponentModel.Category("PLC Properties")>
<System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)>
Public ReadOnly Property PLCAddressValueItems() As System.Collections.ObjectModel.ObservableCollection(Of MfgControl.AdvancedHMI.Drivers.PLCAddressItemEx)
Get
Return m_PLCAddressValueItems
End Get
End Property
Public Property PLCAddressVisible As String
#End Region
-
Archie it placed the option in the properties but it is having no effect. Is the "Embedded variable "VISIBLE TRUE/FALSE" overriding the new code?
'*****************************************
'* Property - Address in PLC to Link to
'*****************************************
Private m_PLCAddressValueItems As New System.Collections.ObjectModel.ObservableCollection(Of MfgControl.AdvancedHMI.Drivers.PLCAddressItemEx)
<System.ComponentModel.BrowsableAttribute(True), System.ComponentModel.EditorAttribute(GetType(PLCAddressItemEditor), GetType(System.Drawing.Design.UITypeEditor))>
<System.ComponentModel.Category("PLC Properties")>
<System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)>
Public ReadOnly Property PLCAddressValueItems() As System.Collections.ObjectModel.ObservableCollection(Of MfgControl.AdvancedHMI.Drivers.PLCAddressItemEx)
Get
Return m_PLCAddressValueItems
End Get
End Property
Public Property PLCAddressVisible As String
#End Region
-
If you set Visible to False then run the application, does the chart no longer show?
-
Correct.. It does not and setting the bit to show it doesn't do anything.
I tried both ways. TRUE and FALSE and set and reset the bit that is supposed to control the PLC Address visible but nothing happens. Whatever value I enter (TRUE / FALSE) that is what I get.
If you set Visible to False then run the application, does the chart no longer show?
-
In the ChartWithLogging.vb file, go to line 344 and set a breakpoint. This is the code at line 344:
Try
'* Write the value to the property that came from the end of the PLCAddress... property name
Me.GetType().GetProperty(e.SubscriptionDetail.PropertyNameToSet).
SetValue(Me, Utilities.DynamicConverter(e.PLCComEventArgs.Values(0),
Me.GetType().GetProperty(e.SubscriptionDetail.PropertyNameToSet).PropertyType), Nothing)
Run the application and if it stops at the breakpoint, hover over PropertyNameToSet and see what the value is.
-
Took me a wee bit to figure out how to do that...
Property Value is set to "As String". See image in case I did not do something right.
-
When you run the application, it should stop at that breakpoint. It will show a yellow arrow in the red dot. When it is stopped there, hover over PropertyNameToSet to see what the actual value is.
-
Archie I must be doing something wrong - it is not stopping = I only have the chart and a datasubscriber to test the popup screen and two buttons on the main form to test the the two things you gave ,me.. and the test popup screen in the application.
Breakpoint seems to be ignored. In case it matters I am still running 399y BETA 33. Haven't seen anything in latest releases that concerned anything I do.I am using Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.1.3
I have pored over this and don't know what I could be missing, inserting a breakpoint seems pretty straight forward; I am running the app from the debugger so ???????????????????
Yes I feel stupid.... Never seen a program I couldn't break before. That has to be a new one.
-
Archie I found out that the BREAKPOINT not working is an old issue going back as far as 2015. I am surprised it is still an issue using VS 2022 and a new project.
I have followed all the steps to correct it but still no joy. I will create a new project and start this all over again and see what happens.
I will let you know once I get the breakpoint to work.