Hmm, then I suppose that part isn't what is a mystery to me, it would be where in BasicTrendChart it deals with the information coming back from the Subscription.
ch
I can see where BasicTrendChart creates a ComComponent as m_ComComponent if it doesn't already exist, then subscribes to it with SubscribeToComDriver()
I also see the Public Property for Value, which I (assume) to be where a point is added, by an added value.
s
I then see there's a SubscribeAutoProperties contained within the SubscriptionHandler class, as well as event handlers such as SubscribedDataReturned(BV s A o, BC e A PlcComEventArgs)
I'm just struggling to find where exactly I'd want to make a change for my desired behavior. I have a suspicion that in SubscribedDataReturned, I'd want to do something such as the following, but I just really don't know for sure (and I've spent a pretty substantial amount of time fiddling around with things trying to get them working as intended to no avail.)
Private Sub SubscribedDataReturned(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
For Each Subscript In m_SubscriptionList
Dim address As String = Subscript.PLCAddress
If Subscript.Invert Then
address = Subscript.PLCAddress.Substring(4)
End If
If e.ErrorId = 0 Then
'If (e.PlcAddress Is Nothing) OrElse (String.Compare(address, e.PlcAddress, True) = 0) Then
If (e.PlcAddress Is Nothing) OrElse (e.SubscriptionID = Subscript.NotificationID) Then
Dim a As New SubscriptionHandlerEventArgs
a.PLCComEventArgs = e
a.SubscriptionDetail = Subscript
If e.Values IsNot Nothing AndAlso e.Values.Count > 0 Then
'* Check if the value should be inverted
If Subscript.Invert Then
'* Try to invert a boolean value
Try
Dim ea As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs
'* Clone the EventArgs for the inversion because there may be another subscription that doesn't need inverted
ea = CType(e.Clone, MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
Dim x As New System.Collections.ObjectModel.Collection(Of String)
' HERE IS MY CHANGED CODE
If e.Values(0) = True Then
Dim s As String = "1"
ElseIf e.Values(0) = False Then
Dim s As String = "0"
Else
Dim s As String = (Convert.ToString(Not CBool(e.Values(0))))
End If
' EVERYTHING AFTER THIS UNCHANGED
It seems like this would be the most logical place for me to make a change to an existing class, but it would have to be *specific* to this particular application. But, from how you understand AdvancedHMI to function - as the creator - does this look like it would work? Or am I entirely off base here?