Hello Guest it is March 29, 2024, 06:21:52 AM

Author Topic: Direct DRO input without hightlight DRO  (Read 2135 times)

0 Members and 1 Guest are viewing this topic.

Direct DRO input without hightlight DRO
« on: April 28, 2017, 06:47:04 AM »
Hello,

I'm working on a custom screen for a project I'm doing.  What I would like to do is have a "keypad" on the mach screen that is made up of buttons. and the buttons when touched would direct input to a DRO .. I know about SetOEMDRO. and that may work but what I am wanting is to have number keys like a number pad and then also have fraction keys... so if I want to input 12.0625 into the DRO I would just hit  button "1" "2" and button "1/16" then "enter".  I know I could do this with a keypad but I would like to not have to select the DRO but rather any time I hit those buttons it inputs what I hit to the DRO

I'm not sure if this is actually possible though using a macro and SetOEMDRO?

Thanks!

Jeff Tice

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Direct DRO input without hightlight DRO
« Reply #1 on: April 28, 2017, 12:07:01 PM »
hi Jeff,

i am not realy sure, what you like to do, but if i understand you right something like this should work:

lets say you like to modify OEMdro2000 and you hit the "key" 1 on your virtual Keyboard the VBmakro for KEY1 could
be something like this:

Code: [Select]
Sub Main

  ActValue = GetOEMDro(2000)

  If ((ActValue  <= 9) AND (ActValue  > 0)) Then
    ActValue = ActValue * 10
    GoTo write
  End If

  If ((ActValue  <= 99) AND (ActValue  > 0)) Then
    ActValue = ActValue * 100
    GoTo write
  End If

  If ((ActValue  <= 999) AND (ActValue  > 0)) Then
    ActValue = ActValue * 1000
    GoTo write
  End If

  If ((ActValue  <= 9999) AND (ActValue  > 0)) Then
    ActValue = ActValue * 10000
    GoTo write
  End If

  If ((ActValue  <= 99999) AND (ActValue  > 0)) Then
    ActValue = ActValue * 100000
    GoTo write
  End If

write: ActValue=ActValue+1 'Key 1 was pressed

SetOEMDro(2000,ActValue)

End sub
code not tested, just written down.

Thomas








« Last Edit: April 28, 2017, 12:14:39 PM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Direct DRO input without hightlight DRO
« Reply #2 on: April 28, 2017, 03:25:42 PM »
Thanks Thomas!

I think I get the idea.  I've played with it some and think I can make it work how I want to.

Thanks!!

Jeff