Hello Guest it is March 29, 2024, 01:40:37 AM

Author Topic: need a macro  (Read 2109 times)

0 Members and 1 Guest are viewing this topic.

need a macro
« on: June 28, 2010, 12:42:51 PM »
Hello All

Trying to jog my x axis +.020 once if input 4 is not active, (Pappabear) or scott was kind enough to get me started but im still needing some help!

Scott wrote this
well it might be easier to put a custom macro at the start of your g code file.
i.e. M1000.m1s 
I am not at my work computer so you will have to look up the OEM VB codes below.

You might want to double check my VB also, but you want to look for your input being active.
INPUTx below could be INPUT1-4   (or you could use the OEMs 1-15).
also on your general config page, you will need to set up your Step jog DROs with at least one of them with the value
of 0.02 in it, let us say that is the first value box.

'M1000.m1s

MyNeededInput = IsActive(INPUTx)

If Not(IsActive(MyNeededInput) Then
   If Not(GetOEMLED(*********)) Then        'look up the OEM LED code for the Machine is in Step/Jog mode (not continous or MPG).
      DoOEMButton(*********)                    'Do the button to put the machine into Step/Jog mode.
      DoOEMButton(*********)                    'set the step jog value to the first dro value box OEM button
      DoOEMButton(*********)                    'Push the Jog Button for the X+ direction
      While IsMoving()
      Wend
   Else
      DoOEMButton(*********)                    'set the step jog value to the first dro value box OEM button
      DoOEMButton(*********)                   'Push the Jog Button for the X+ direction
      While IsMoving()
      Wend 
   End If
End if

'scott


If Not Is Active (Input 4) Then
   If Not(GetOEMLED15) Then        This is for Jog Mode Incr
      DoOEMButton(15)                    'Do the button to put the machine into Step/Jog mode. (?? im lost here)
      DoOEMButton(193)                  ' Select Jog increment 3, i have set it to .020
      DoOEMButton(307)                    'Push the Jog Button for the X+ direction
      While IsMoving()
      Wend


Its a start I think ???
josh