Author Topic: enter string on alphanumeric keyboard for basicLabel  (Read 3294 times)

robkwan

  • Newbie
  • *
  • Posts: 44
    • View Profile
enter string on alphanumeric keyboard for basicLabel
« on: May 18, 2016, 02:15:43 PM »
How to enter string into the basicLabel using the alphanumeric virtual keyboard?

When alpha is entered, hit the ENTER key, this error is displayed. "Failed to validate value. Conversion from string ABC to type Double is not valid.

I think the 2 tags associated with the basicLabel need to be string. How to declared a Modbus tag is for a string value?

I need to have a textbox to enter password from a virtual keyboard.

robkwan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: enter string on alphanumeric keyboard for basicLabel
« Reply #1 on: May 18, 2016, 04:08:00 PM »
To work around the problem, I manually use new MfgControl.AdvancedHMI.Controls.AlphaKeyboard().ShowDialog().

Is it possible to displayed the entered characters as "*"?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: enter string on alphanumeric keyboard for basicLabel
« Reply #2 on: May 18, 2016, 05:33:54 PM »
Modbus does not support strings. You would have to write code to convert an array of integers to and from a string. This is an example:
Code: [Select]
    Private Function ConvertIntsToString(ByVal ints() As String) As String
        '* Convert values to an array of bytes
        Dim ByteArray(ints.Length * 2 - 1) As Byte
        For i = 0 To ints.Length - 1
            '* Upper byte
            ByteArray(i * 2) = CByte((CInt(ints(i)) >> 8) And 255)
            '* Lower byte
            ByteArray(i * 2 + 1) = CByte(CInt(ints(i)) And 8)
        Next

        '* Convert the array of bytes to a string
        Dim result As String
        result = System.Text.Encoding.UTF8.GetString(byteArray)

        Return result
    End Function

DanieLoche

  • Guest
Re: enter string on alphanumeric keyboard for basicLabel
« Reply #3 on: July 11, 2016, 11:02:13 AM »
Hello,

I'd like to throw up this thread as I'รง having the same case :

I'm doing a login form for a AdvancedHMI used in Raspberry Pi.
So I need a control with the following properties :
- show a virtual keyboard when used, to tap the password in the touchscreen.
- show * caracters instead of the password.

The textLabel basic control can show *** instead of the textm but I can't figure how to show a keyboard to enter the password.
The basicLabel control can show a virtual Keyboard, but I can't find how to hide the input...

Any solution ?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: enter string on alphanumeric keyboard for basicLabel
« Reply #4 on: July 11, 2016, 11:22:41 AM »
I posted a keypad control that has a property for password characters:

http://advancedhmi.com/forum/index.php?topic=1368.0

DanieLoche

  • Guest
Re: enter string on alphanumeric keyboard for basicLabel
« Reply #5 on: July 12, 2016, 09:33:18 AM »
Oh thank you I'll take a look at that. :)