AdvancedHMI Software
General Category => Support Questions => Topic started by: bachphi on August 11, 2016, 03:56:45 PM
-
I tried setting up a keypad with min, max values, but it keep saying the value I entered is not within the range(92, 125), eventhough it is . I tried to add CDbl or Cint, since they are real numbers from PLC, but with the same result.
It works fine without the min, max range
Private Sub EnterTipNumber()
Dim kpd As New MfgControl.AdvancedHMI.Controls.Keypad
kpd.Font = New Font("Arial", 12, FontStyle.Bold)
kpd.ForeColor = Color.AliceBlue
kpd.Text = "Enter Tip Number:"
kpd.MaxValue = CInt(PLC.Read("Sta0xPart.TipRange.HiLimit"))
kpd.MinValue = CInt(PLC.Read("Sta0xPart.TipRange.LoLimit"))
If kpd.ShowDialog = Windows.Forms.DialogResult.OK Then
PLC.Write("Sta0xPart.TipRange.Value", kpd.Value)
End If
End Sub
-
I directly harcoded some numbers in there ( 100, 150) and it still said number must be >100 and <150. !!
The keypad from BasicLabel seemed to work properly, but how do I bring the keypad up without actually clicking the label.
-
This is actually a bug in the keypad. The check works using the BasicLabel because it does not make use of the Min/Max within the keypad object. This is how the BasicLabel does the check:
If m_KeypadMaxValue <> m_KeypadMinValue Then
If KeypadPopUp.Value < m_KeypadMinValue Or KeypadPopUp.Value > m_KeypadMaxValue Then
System.Windows.Forms.MessageBox.Show("Value must be >" & m_KeypadMinValue & " and <" & m_KeypadMaxValue)
Exit Sub
End If
End If
-
After scanning the label, I need to call up the keypad to enter some value. How do I call the Keypad in BasicLabel without clicking it?? Thanks Archie.
-
Is the scanned label going into the PC or PLC?
-
It's USB scanner, so I scanned it in to PC first, validate the serial number, then pass it on to BasicLabel which go to PLC.
This is my work around:
Private Sub EnterTipNumber()
Dim kpd As New MfgControl.AdvancedHMI.Controls.Keypad(300) 'width=300
kpd.Font = New Font("Arial", 12, FontStyle.Bold)
kpd.ForeColor = Color.AliceBlue
kpd.Text = "Enter Tip Number:"
kpd.StartPosition = Windows.Forms.FormStartPosition.CenterScreen
kpd.TopMost = True
blTipRange.KeypadMaxValue = PLC.Read("Sta0xPart.TipRange.HiLimit")
blTipRange.KeypadMinValue = PLC.Read("Sta0xPart.TipRange.LoLimit")
If kpd.ShowDialog = Windows.Forms.DialogResult.OK Then
If blTipRange.KeypadMaxValue <> blTipRange.KeypadMinValue AndAlso kpd.Value <> "" Then
If kpd.Value < blTipRange.KeypadMinValue Or kpd.Value > blTipRange.KeypadMaxValue Then
System.Windows.Forms.MessageBox.Show("Value must be >" & blTipRange.KeypadMinValue & " and <" & blTipRange.KeypadMaxValue)
Exit Sub
End If
PLC.Write("Sta0xPart.TipRange.Value", kpd.Value)
blTipRange.Value = kpd.Value
End If
End If
End Sub
-
Version 3.99p will give the ability to pop up a keypad of a BasicLabel via code to make this easier.
-
Thank you, Archie!