Hello Guest it is May 21, 2019, 03:20:26 PM

Author Topic: neww help for script and button.  (Read 1863 times)

0 Members and 1 Guest are viewing this topic.

Offline ronny

*
  •  17 17
    • View Profile
neww help for script and button.
« on: December 09, 2014, 10:00:05 PM »
Hllo,

i have a cnc machine to cut kite board. i usually mill the top and turn the board and mill the bottom. my problem is that when i turn the board i have to line it up perfectly to match  the top cut so i made a laser that i turn on on the output 2 (i use the mist button) and i bring my machine to the center of the board so the laser can be seen on the middle of the board.

i need a button that would say "center board" that would go to this location Y-380 and turn on the laser all in one. would that be difficult for someone that knows what to do?

i tried and i am terrible. did ok at building the machine but the computer part is difficult for me.
i would be happy to pay for time.

Offline Chaoticone

*
  • *
  •  5,493 5,493
  • Precision Chaos
    • View Profile
Re: neww help for script and button.
« Reply #1 on: December 10, 2014, 12:35:32 AM »
This has no checks in it (I would at least add a move to get the Z up if it wasn't already) and you may want to change the output to something other than 2 if you have it configured for mist.

Code: [Select]
Code "G00 Y-380"
While IsMoving ()
Sleep 100
Wend
ActivateSignal(OUTPUT2)
« Last Edit: December 10, 2014, 12:37:19 AM by Chaoticone »
;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 dude1

*
  •  1,253 1,253
    • View Profile
Re: neww help for script and button.
« Reply #2 on: December 10, 2014, 03:15:03 AM »
zero laser (put it in a button script)

Xs = GetOemDRO(59) 'X-Scale DRO
Ys = GetOemDRO(60) 'Y-Scale DRO
Xmove = -73.3844 * 1/Xs 'Move distance adjusted for X-Scale factor
Ymove = 10.7438 * 1/Ys 'Move distance adjusted for Y-Scale factor
DeActivateSignal(OUTPUT5) 'Turn off laser
Code "G91 G0 X" &Xmove & "Y" &Ymove ' Makes an incremental move the distances that you set
While IsMoving () ' Waits while that happens
Wend
Code "G90" 'Goes back to absolute moves
DoOEMButton (1008) 'Zero X-Axis DRO
DoOEMButton (1009) 'Zero Y-Axis DRO

Laser on off (put it in button script)

f IsOutputActive(OUTPUT5) Then ‘Check to see if its on
DeActivateSignal(OUTPUT5) ‘Its on so turn it off
Else
ActivateSignal(OUTPUT5) ‘Its off so turn it on
End If

this code is from http://www.cooperman.talktalk.net/files/17.htm

I use it every day it works every time for info of how to use it look at web site all thanks go to tweakie.

just edit it to your needs
« Last Edit: December 10, 2014, 03:16:42 AM by daniellyall »

Offline ronny

*
  •  17 17
    • View Profile
Re: neww help for script and button.
« Reply #3 on: December 10, 2014, 12:59:10 PM »
Thanks! will try that,

as for a button do i make one on illustrator and somehow insert it in the gui?

i can design a button that will look decent but not so sure i can insert it . i downloaded the designer, i think its out of my league if someone can help.

thanks friends

Offline ronny

*
  •  17 17
    • View Profile
Re: neww help for script and button.
« Reply #4 on: December 10, 2014, 03:26:58 PM »
works,

downloaded mach screen,

made a button, press execute code, entered the code posted above and boom!

thanks so much!


Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: neww help for script and button.
« Reply #5 on: December 10, 2014, 04:57:36 PM »
no problem but go read the info on tweakie`s web site for it so you under stand what's going on