Hello Guest it is March 28, 2024, 06:18:18 PM

Author Topic: Mach3 and a tube bender  (Read 48981 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach3 and a tube bender
« Reply #50 on: February 18, 2009, 10:29:09 AM »
I changed the above code to "If GetOEMLED(164)..." and "If GetOEMLED(165)..."

When I type in M3 or M4 into the MDI, my relays energize less than one second.  How can I make it stay on?

The above was earlier today.  By checking "Immediate Relay Off Before Delay", I was able to at least get one of the relays to energize.  It is very weird though:

If I type in M3 at the MDI, Relay CW energizes less than one second, then immediately shuts off and energizes Relay CCW (m4).  It won't shut off until I send command M5.

If I type in M4, Relay CCW energizes less than one second, and shuts off.

Now, if I un-check "Immediate relay off before delay", I get the same result... very weird.
« Last Edit: February 18, 2009, 04:23:55 PM by supahonkey »
Re: Mach3 and a tube bender
« Reply #51 on: February 18, 2009, 04:50:19 PM »
IT WORKS! (somewhat)

Scott's macropump is functional.  When I type M3, output 2 energizes until the desired angle is equal to the current angle.  When I type M4, output 3 energizes if the desired angle <= current angle.  I want output 3 to energize until current angle = 0.  I am going to see how far I can get, though I am still new to VB.

if GetOEMLED(164) or GetOEMLED(165) then 'if the CW or CCW led is on

   if GetOEMLED(164) then 'if the spindle CW led is on.
      if CurrentAngPos <= DesiredAnglePos then
      ActivateSignal(OUTPUT2) 'coil A cw
      else
      DeActivateSignal(OUTPUT2)
      end if   
   end if

   if GetOEMLED(165) then 'if the spindle CCW led is on.
      if CurrentAngPos >= DesiredAnglePos then
      ActivateSignal(OUTPUT3) 'coil B ccw
      else
      DeActivateSignal(OUTPUT3)
      end if   
   end if
   
end if



Is it possible to program a button to send the G-Code "M3"?  I would like to have another button to send the code "M4".
« Last Edit: February 18, 2009, 04:52:05 PM by supahonkey »
Re: Mach3 and a tube bender
« Reply #52 on: February 18, 2009, 05:02:20 PM »
YEs you can add an M3 and an M4 button...

Just add the button in screen designer...
in mach edit the buton script and put in it:

Code "M3" (or m4)

and save the script... no need to fiddle with file names... otherwise it wont save it to the button.

Regards
Fernando

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach3 and a tube bender
« Reply #53 on: February 18, 2009, 05:38:56 PM »
 8)

So do I get a "U DA MAN?".........  hehehehe

on a serious note: a few things I thought of, make sure you "Spindle" motor output is enabled (even though you may not be using one).

also When you Issue a M3 or M4 command Also Issue a S command to...  i.e.  S100 M3, or S100 M4.
Make sure that the range of "Pulley 1" is from 0-1000 or something so that S word falls in that range.
I dont think your M3 or M4 will Stay ON, if there is NO Spindle speed set..........

scott
fun times
Re: Mach3 and a tube bender
« Reply #54 on: February 18, 2009, 05:43:39 PM »
SCOTT -----> U DA MAN!

I can't thank you enough for all of your help.

All of my programming issues have been a result of my user created screen.  I can't get the ActivateSignal(Output) command to work unless I modify 1024.set.  Nothing happens if I run it on my own screen.

I added my own screen to 1024.set, but I can't figure out how to pull it up once 1024.set has been loaded.  I made it on page 11, but how do I pull up page 11 in Mach?
Re: Mach3 and a tube bender
« Reply #55 on: February 18, 2009, 06:02:02 PM »
Hi,
on Screen designer you have to add a button, and on OEM code put an 11

that should change to page 11 once you press it.

Regards
Fernando
Re: Mach3 and a tube bender
« Reply #56 on: February 18, 2009, 06:33:14 PM »
Thanks Fernando.  I would like to create a button to Zero the Desired Angle UserDRO.  The current UserDRO is 2000.  I assume code must be written since it is a UserDRO.  Does anyone know the VB code to zero UserDRO2000?

Thanks.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Mach3 and a tube bender
« Reply #57 on: February 18, 2009, 06:42:52 PM »
Call SetUserDro(2000,0)

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach3 and a tube bender
« Reply #58 on: February 18, 2009, 06:47:49 PM »
ok a few more:

first you typed: ActivateSignal(Output), it is ActivateSignal(OUTPUT#), number being 1-20 and ALL caps for OUTPUT.

To Zero a UDRO put a button called Zero Angle Dro or what ever.

in the button in screen designer, tick the VB button screen three, in 4 you have to hit the Edit Button script,

Script is:

SetUserDRO(2000,0)

'that is it that will set UDRO 2000 to Zero.

scott
fun times
Re: Mach3 and a tube bender
« Reply #59 on: February 18, 2009, 06:49:20 PM »
Damm! two replies while i was typing mine!

great group of guys we got here!