Hello Guest it is April 19, 2024, 05:52:50 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - supahonkey

Pages: 1 2 3 »
1
General Mach Discussion / Re: Mach3 and a tube bender
« on: February 18, 2009, 07:06:01 PM »
Ha!  Thanks for all of your help.

I just started having some really weird issues.  My Retract (M4) (output3) is back to turning on really quickly, then turning off.  The LED on the relay board goes bright for less than one second, then flashes very dimly.  I read 0VDC on the incoming 5V signal.  I don't have a problem at all with M3 (output 2).  Very weird... any ideas?

I had a typo a few posts up when I mentioned the ActivateSignal(OutputX) function.  I did type it the correct way in the macro.

2
General Mach Discussion / Re: Mach3 and a tube bender
« 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.

3
General Mach Discussion / Re: Mach3 and a tube bender
« 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?

4
General Mach Discussion / Re: Mach3 and a tube bender
« 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".

5
General Mach Discussion / Re: Mach3 and a tube bender
« 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.

6
General Mach Discussion / Re: Mach3 and a tube bender
« on: February 18, 2009, 09:17:45 AM »
Scott,

I finally got the ActivateSignal and DeActivateSignal commands working as a Macropump.  I have two limit switches.  I made a macropump with two if statements:

'Macropump.m1s

If GetOEMLed(833) Then
ActivateSignal(Output3)
Else
DeactivateSignal(Output3)
End If 
 
If GetOEMLED(830) Then
ActivateSignal(Output2)
Else
DeactivateSignal(Output2)
End If

If I close the switches, their respective Outputs energize.  If I have my own screen loaded, the Macropump doesn't work.  If the default 1024.set screen is loaded, the Macropump works.  Why is that happening?  I bet I could Scott's script to work if I could overcome this issue.

7
General Mach Discussion / Re: Mach3 and a tube bender
« on: February 17, 2009, 09:31:12 PM »
Please correct me if I am wrong, but I would assume something as simple as the following code would work:

If GetOEMLED(1200) Then 'If OEMLED1200 is active
ActivateSignal(OUTPUT2) 'Activate Output2
Else
DeActivateSignal(Output2) 'Deactivate Output2
End If

I have a button that turns on OEMLED1200.  When I hit this button, the LED turns green.  Based on the above code, I would expect for Ouput2 to go high.  Unfortunately I read nothing with the multimeter.  And yes, Output2 is configured.  If I check ActiveLow for Output 2, my relay becomes energized.

8
General Mach Discussion / Re: Mach3 and a tube bender
« on: February 17, 2009, 09:04:57 PM »
Ah, it seems like everything I do never works at first.  I can only get fer mayrl's simple script to work.  Scott - I cannot get your script to do anything.  It throws no syntax errors, it just does nothing.  I tried adding fer mayrl's suggestion to Scott's original code: (Bold reflects the new stuff)

'Goto angle
'Macropump.m1s

DesiredAnglePos = GetUserDRO(2000) 'angle entry dro on your screen
CurrentAngPos= GetOEMDRO(29) 'encoder1 DRO from your die

If GetOEMLED(164) Or GetOEMLED(165) Or GetOEMLED(1200) Then 'if the CW or CCW led is on

   If GetOEMLED(164) And GetOEMLED(1200) Then 'if the spindle CW led and the limit switch is on.
      If CurrentAngPos <= DesiredAnglePos Then
      ActivateSignal(OUTPUT2) 'coil A cw
      Else
      DeActivateSignal(OUTPUT2)
      End If   
   End If

   If GetOEMLED(165) And GetOEMLED(1200) Then 'if the spindle CCW led and the Limit switch is on.
      If CurrentAngPos >= DesiredAnglePos Then
      ActivateSignal(OUTPUT3) 'coil B ccw
      Else
      DeActivateSignal(OUTPUT3)
      End If   
   End If
   
End If   

I still get no response, even if I press the button to light OEMLED1200.  The OemLED1200 does light up, I just get nothing. 

I am having one hell of a time getting Mach to actually save VB scripts when I edit the buttons.  I can only get it to retain code by saving it as the hiddenscript.  If I give the button a new name, such as CW, I can close the editor, click View > Save Current View, go back to the button editor, click the button, and there is absolutely no code present.  I googled the problem and everyone's suggestion was to click "Save Current View." 


9
General Mach Discussion / Re: Mach3 and a tube bender
« on: February 16, 2009, 04:58:37 PM »
Here is my "new" code.  I believe I have added the correct stuff.  I can get the LED(830) to turn on when I close the limit switch.  It's weird why my OEMButton and OEMLed for Output 4 won't work.  I still can't get the program to respond to anything.  Here is the code:

'Goto angle
'Macropump.m1s

DesiredAnglePos = GetUserDRO(2000) 'angle entry dro on your screen
CurrentAngPos= GetOEMDRO(29) 'encoder1 DRO from your die

If GetOEMLED(164) Or GetOEMLED(165) Or GetOEMLED(830) Then 'if the CW or CCW or the Limit switch is open, led is on

   If GetOEMLED(164) And GetOEMLED(830) Then 'if the spindle CW led and the limit switch is on.
      If CurrentAngPos <= DesiredAnglePos Then
      ActivateSignal(OUTPUT2) 'coil A cw
      Else
      DeActivateSignal(OUTPUT2)
      End If   
   End If

   If GetOEMLED(165) And GetOEMLED(830) Then 'if the spindle CCW led and the Limit switch is on.
      If CurrentAngPos >= DesiredAnglePos Then
      ActivateSignal(OUTPUT3) 'coil B ccw
      Else
      DeActivateSignal(OUTPUT3)
      End If   
   End If
   
End If   


10
General Mach Discussion / Re: Mach3 and a tube bender
« on: February 16, 2009, 04:33:00 PM »
Fer Mayrl,

Essentially, you are suggesting I add an OEM button and an OEMled.  The OEMbutton will turn on an OEMled.  Once the aforementioned OEMled is on, then the loop will start?  How do I make a button trigger an LED to turn on?

Using my existing interface, I added OEMbutton(233), which turns on Output 4.  Next to the button I have OEMLed(77), which turns on when Output4 is energized.  When I load my screen in Mach3, the LED does not turn on if I click the button.  I can get OEMLed(830) on but hitting one of my limit switches.  Any idea why I can't get an OEMbutton to turn on a corresponding OEMled?

Pages: 1 2 3 »