Author Topic: GraphicIndicator bug  (Read 1463 times)

andreaboschetti71

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
GraphicIndicator bug
« on: November 03, 2014, 05:47:31 AM »
Hello, in new 3.8 version graphic indicator does'nt work well. I already have error message "invalid value returned".
The problem I think is in PropertyToWrite in subscription sub. Debugging code I see that PropertyToWrite is setted as "GraphicSelect1" but I think that the correct value to write to is "ValueSelect1"

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: GraphicIndicator bug
« Reply #1 on: November 03, 2014, 06:32:59 AM »
You are correct. Version 3.80 must follow the pattern for naming properties as PLCAddress<propertyname>, where <propertyname> is the property the returned value will be put into. This is the corrected code:

Code: [Select]
    '*****************************************
    '* Property - Address in PLC to Link to
    '*****************************************
    Private m_PLCAddressSelect1 As String = ""
    Public Property PLCAddressValueSelect1() As String
        Get
            Return m_PLCAddressSelect1
        End Get
        Set(ByVal value As String)
            If m_PLCAddressSelect1 <> value Then
                m_PLCAddressSelect1 = value
                '* When address is changed, re-subscribe to new address
                SubscribeToCommDriver()
            End If
        End Set
    End Property

    '*****************************************
    '* Property - Address in PLC to Link to
    '*****************************************
    Private m_PLCAddressSelect2 As String = ""
    Public Property PLCAddressValueSelect2() As String
        Get
            Return m_PLCAddressSelect2
        End Get
        Set(ByVal value As String)
            If m_PLCAddressSelect2 <> value Then
                m_PLCAddressSelect2 = value
                '* When address is changed, re-subscribe to new address
                SubscribeToCommDriver()
            End If
        End Set
    End Property