Hello Guest it is March 28, 2024, 05:28:57 PM

Author Topic: Macropump help  (Read 13855 times)

0 Members and 1 Guest are viewing this topic.

Macropump help
« on: April 05, 2007, 09:06:15 PM »
I need some code help.  I have the following:

If IsActive(Input1) Then      'Read input 1
     DoOEMButton(310)         'activate the "Y--" jog button
End If

I just want to make this button jog in the Y axis.
It works except that when you let go of the button the axis does
not stop.  Electrically, it is working fine as witnessed by the
ModIO LED indicator going out when you let go of the button.
Do I have to look for when the button is not pressed and do some
sort of a reset?

Also,
How do you change the state of a led on the screen?
I have tried:

Call SetOEMLed(66,1)       '66 is the OEM number of the block del led
 
I tries several variations and it always
 returns an error: Function not defined SetOEMLed

The Mach customization WIKI that lists the OEM LED's says this is a
valid call.

Thanks,
Scott

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Macropump help
« Reply #1 on: April 05, 2007, 10:32:02 PM »
well here is the deal,

  Jogs only work "Right", when you push the keyboard hotkey, or click a job button on the screen, or an hardware input will jog it.

But, VB jogging doesnt work right, when you "push it" the axis will take off and not stop. This is a problem I ran into also, and that is what Brian told me, it has something in the way that mach works with the jog inputs.

Second:  You cannot set the state of an OEM Led, it will only toggle via, buttons that control its status.

scott
fun times
Re: Macropump help
« Reply #2 on: April 06, 2007, 02:07:39 PM »
You should not jog the axis from VB.. if you need an input to Jog the machine please use the Jog inputs under inputs on the ports and pins page


Thanks
Brian
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Macropump help
« Reply #3 on: April 06, 2007, 05:20:04 PM »
Thanks Brian.  I hand no idea they were there.   :)

Scott



Re: Macropump help
« Reply #4 on: April 06, 2007, 08:21:04 PM »
Ok.  I got my jog switches up and running.  Thanks Brian.

How do I handle operating the Reset button with a switch on my pendant?
Is this doable?

Thanks,
Scott

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Macropump help
« Reply #5 on: April 06, 2007, 08:28:46 PM »
Same place, it is the one that says e-stop.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Macropump help
« Reply #6 on: April 07, 2007, 07:14:13 AM »
OK.  So e-stop and reset are the same.  I guess I need to use another hard input
for that.  Running out quickly.  I think that the Sound Logic BOB uses this input. 
When you hit a limit switch Mach immedietly goes into reset. 
I want to be able to reset the software without resorting to the mouse, not e-stop it. 
I somehow doubt that I can do this now if the Sound Logic board uses this input.

Any Ideas?

Scott



Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Macropump help
« Reply #7 on: April 07, 2007, 08:27:21 AM »
Scott,
     Could you just take the wire form your board and run it through your e-stop button on your pendent or daisy chain the button, it would use the same input. Do you have a link for your board that I can look at? Also, what kind of drives are you using? There are lots of ways to do it, with the e-stop circuit, the main thing is safety. I have sent you a personal message.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Macropump help
« Reply #8 on: April 07, 2007, 10:11:50 AM »
'I think I know what you want, do this:

'note you don't have to actually have these listed LED's and Dros physicaly on the screen set but,
'you can add them with screen designer if you want. we will use UserLed 1200, and userDro 1200
'Use any one of your free Inputs, in the example, I used INPUT4, but use what you want.
'Depending on your set up of your Input, remember to set the Active high or low depending on what your input does.

'In your Macropump put the following, save it, then goto cofig and turn on macropump, close mach and reopen

'MacroPump.m1s

If IsActive(INPUT4) and Not(GetUserLED(1200)) and GetUserDRO(1200)=0 Then
   SetUserLED(1200,1)    'This sets a "counter" it allows the "button" to be pushed only once.
   SetUserDRO(1200,1)   'This is optionally in case you want to drop a LED to see the state
   DoOEMButton(1021)    'this "Pushes" the reset button
Else
   SetUserLED(1200,0)     'When you release the button, the system resets for next push
   SetUserDRO(1200,0)
End If


'Hope this is what you wanted
'Scott

fun times
Re: Macropump help
« Reply #9 on: April 08, 2007, 06:37:20 PM »
Thanks Scott,
What I was really looking for was the OEM button number for the reset.  I didn't
think one existed.  I must have looked up and down my sheets 50 times and still
missed the reset.  You posted it as 1021 and there it was....on my sheet looking me
straight in the face. 
Your code is interesting but it looks like it is for a latching switch.  I am using
pushbutton switches off of a voltage divider and feeding my ModIO analog input.
I am running 12 pushbutton switches into one analog input. 


What I REALLY need is a method of debouncing these switches.  The Single step is the
worst.  You need to hit it just right for it to consistantly work.  The  Feed up and Feed
down are also a bit nuts.  Sometimes they increment it more than the 10% value they
should be doing.  I tried a few things to slow down the switch polling but it only caused
problems with Mach. 

Any ideas?

Scott