Author Topic: Selector Switch 3 pos  (Read 1711 times)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Selector Switch 3 pos
« on: February 19, 2017, 01:59:52 PM »
v399t , micrologix 1400 , EthernetIPforSLCMicroCom ,  SelectorSwitch3pos , when bit for right or left is true the switch will display that correctly it will change from right to left , but when both are false it wont move to the center position

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5325
    • View Profile
    • AdvancedHMI
Re: Selector Switch 3 pos
« Reply #1 on: February 19, 2017, 02:49:43 PM »
Edit SelectorSwitch3Pos.vb and go to line 138, then comment out the 4 lines as shown here:
Code: [Select]
    Public Property ValueLeft As Boolean
        Get
            Return (Value = ValueOfLeftPosition)
        End Get
        Set(value As Boolean)
            '    If Me.Value <> ValueOfLeftPosition Then
            If value Then
                    Me.Value = ValueOfLeftPosition
                ElseIf Not ValueRight Then
                    Me.Value = ValueOfCenterPosition
                End If
            'm_ValueLeft = value
            ' End If
        End Set
    End Property

    'Private m_ValueRight As Boolean
    Public Property ValueRight As Boolean
        Get
            Return (Value = ValueOfRightPosition)
        End Get
        Set(value As Boolean)
            '  If Me.Value <> ValueOfRightPosition Then
            If value Then
                    Me.Value = ValueOfRightPosition
                ElseIf Not ValueLeft Then
                    Me.Value = ValueOfCenterPosition
                End If
            'm_ValueRight = value
            '    End If
        End Set
    End Property

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: Selector Switch 3 pos
« Reply #2 on: February 19, 2017, 08:26:23 PM »
Starting at line 133 looks quite different not sure what to do here


Code: [Select]
   '*****************************************
    '* Property - Address in PLC to Link to
    '*****************************************
    Private m_PLCAddressClickLeft As String = ""
    <System.ComponentModel.Category("PLC Properties")> _
    Public Property PLCAddressClickLeft() As String
        Get
            Return m_PLCAddressClickLeft
        End Get
        Set(ByVal value As String)
            If m_PLCAddressClickLeft <> value Then
                m_PLCAddressClickLeft = value

                '* When address is changed, re-subscribe to new address
                SubscribeToComDriver()
            End If
        End Set
    End Property

    '*****************************************
    '* Property - Address in PLC to Link to
    '*****************************************
    Private m_PLCAddressClickRight As String = ""
    <System.ComponentModel.Category("PLC Properties")> _
    Public Property PLCAddressClickRight() As String
        Get
            Return m_PLCAddressClickRight
        End Get
        Set(ByVal value As String)
            If m_PLCAddressClickRight <> value Then
                m_PLCAddressClickRight = value

                '* When address is changed, re-subscribe to new address
                SubscribeToComDriver()
            End If
        End Set
    End Property

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5325
    • View Profile
    • AdvancedHMI
Re: Selector Switch 3 pos
« Reply #3 on: February 19, 2017, 08:43:03 PM »
It was a typo... line 183