Artz

Custom Keypads

7 posts in this topic

Posted (edited)

Hi, noobie question... I'm using a NA5 on my sysmac studio 1.17

What is the method or code that I have to type in order to pop a Custom DateTime Keypad up?

I have a button which I set up a subroutine called "calldatekeypad" whenever the button is clicked. But the subroutine is empty because I don't know how to call a keypad on my screen.

Any help is apreciated.

Edited by Artz

Share this post


Link to post
Share on other sites

Posted (edited)

Thank you but this does not help me, the guides never mention how to make a DateTime keypad popup when clicking on a DataEdit. Check out the image, as you can see I cannot establish Date as DataType so the InputMethod will always be NumericKeyPad o QwertyKeyPad.

Maybe I'm blind and cannot see the way to do it, anyways I should formulate the question in another way:

How can I make a DateTime Keypad popup from a DataEdit?

 

whereisdate.jpg

Edited by Artz

Share this post


Link to post
Share on other sites

Posted (edited)

Custom Keypad usage might one of the worst documented feature in NA.

  1. Assuming you know about Custom Keypad already, let's say you have a DateTimeKeypad under Group0 and named DateTimeKeypad0
  2. Then I'd suggest you not to use DataEdit, but instead use the DateTime Standard Control. I don't see the point of using DataEdit when the said control cannot even view Date or Time variables properly.
  3. Now that you have your DateTime control in the Page, assign your Date or Time variable to it as you needed. Lets say the variable name is "MyDate"
  4. Next, add a Press Event to your DateTime control, and assing a CallSubRoutine Action to it. For example we call the subroutine "CallMyKeypad"
  5. Then you create the CallMyKeypad subroutine inside your page, or Global Subroutine if that's necessary. The subroutine should look like something like below. The green parts are just script comment and not necessary.

Sub CallMyKeypad()
      'You'll see a lot of commas here. Basically some parameter on the EditVariable function are not necessary to open the said keypad
      'Important parts are the said Date/Time variable name (MyDate), the Type of the Keypad (DATETIMEKEYPAD)
      'and the Name of the Custom Keypad Group that you want to use (Group0)
      'We do not specify the keypad name explicitly, since one Custom Keypad group can only contain one definition of a Keypad Type

      EditVariable("MyDate", , , , , , , "DATETIMEKEYPAD", , "Group0")

End Sub

You can find more about the EditVariable script in the Instruction Manual from the Help menu when your Sysmac is opening an NA Project.

Edited by innoaloe

Share this post


Link to post
Share on other sites

Yes! Thank you innoaloe! Where did you find this info from? I wouldn't be able to figure this out ever, unless I went instruction by instruction!

It worked like a charm, I need to keep this info secured for the future.

Share this post


Link to post
Share on other sites

I stumbled upon this very same issue once before when a customer asked me about it.
It gave me a headache too, but luckily I spotted the said EditVariable instruction during my search quite fast enough.

The funny thing though, is that the manual for that instruction only gives you hint about using NUMBERKEYPAD and QWERTYKEYPAD custom type. It doesn't even specify that DATETIMEKEYPAD is a correct keyword for that instruction, so I just tried it and luckily it can be used.

There is also a dedicated manual for Custom Keypad (manual number V427) and yet it doesn't even cover this stuff or even mention DateTimeKeypad at all :(

Share this post


Link to post
Share on other sites

Right, I went crazy searching for any hint about all this. Luckily for me you figured out this issue before I could give up and end up coding all from scratch. Thank you :-2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now