Author Topic: SelectorSwitch3Pos1 always in center position  (Read 1114 times)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
SelectorSwitch3Pos1 always in center position
« on: June 08, 2016, 06:01:21 PM »
 ver 399f , SLCMicro driver , Micrologix 1400  , SelectorSwitch3Pos1 always goes to  center position , PLC value left and right are used , Micrologix 1400

Darrell

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: SelectorSwitch3Pos1 always in center position
« Reply #1 on: June 08, 2016, 08:27:57 PM »
- In Solution Explorer, expand down the AdvancedHMIControls project
- Expand down the Controls folder
- Right click SelectorSwitch3Pos.vb and View Code
- Go to line 182 and replace the 2 properties with the following code:
Code: [Select]
    'Private m_ValueLeft As Boolean
    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
« Last Edit: June 09, 2016, 08:13:08 PM by Archie »

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: SelectorSwitch3Pos1 always in center position
« Reply #2 on: June 09, 2016, 07:26:54 PM »
now works ,
thanks Archie