Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: jeffery71 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
-
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:
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
-
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