Author Topic: PLC address to disable keypad input  (Read 4024 times)

thebestg2002

  • Newbie
  • *
  • Posts: 26
    • View Profile
PLC address to disable keypad input
« on: November 16, 2018, 07:32:58 AM »
A PLC address to disable keypad input would be a nice future enhancement.

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: PLC address to disable keypad input
« Reply #1 on: November 16, 2018, 03:59:04 PM »
keyboardinput ?
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: PLC address to disable keypad input
« Reply #2 on: November 17, 2018, 06:57:33 PM »
The keypad will not show simply by not entering an address into the PLCAddressKeypad property field (which is equivalent of being disabled).

But if you still need it then you could add 2 new properties to those controls that have the keypad included:

Code: [Select]
    Private m_KeypadDisable As Boolean
    <System.ComponentModel.Browsable(False)>
    Public Property KeypadDisable As Boolean
        Get
            Return m_KeypadDisable
        End Get
        Set(value As Boolean)
            If m_KeypadDisable <> value Then
                m_KeypadDisable = value
                If KeypadPopUp IsNot Nothing Then
                    If m_KeypadDisable Then
                        KeypadPopUp.Enabled = False
                    Else
                        KeypadPopUp.Enabled = True
                    End If
                    KeypadPopUp.Invalidate()
                End If
            End If
        End Set
    End Property

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

                '* When address is changed, re-subscribe to new address
                SubscribeToComDriver()
            End If
        End Set
    End Property
« Last Edit: November 17, 2018, 07:14:26 PM by Godra »