Acorn Macro/ Sub Program to offset wsc Position

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
kcarpenter1986
Posts: 17
Joined: Mon Aug 24, 2020 6:18 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: Yes
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: No

Acorn Macro/ Sub Program to offset wsc Position

Post by kcarpenter1986 »

Hello,

Can you guys point me in the right direction

Basically I have my WCS # 4 or G75 set to the back corner of my vice.

What I would like to do is make a program that will

G75 X0 Y0 ; Move to x and y 0

M200 "Please insert Y offset" ????????????? At this point I want it to ask me for a y offset and allow me to type this in a box the save this to #101 Im not sure how to do this can any one help?


Then I want to
G00 y[#101] ; Move to offset that was inputted Hopfully

G54 ; Change to WCS#1

Then I want to to make x and y =0 but Im not sure of the code for this


Can any one help me with this

I dont want to use the g52 and offset because I use multiply 3-6 are all permanently set and i never move them so i can get confused. then 1-2 i use as temp homes... thats why I want to do it like this

Thank you


cncsnw
Community Expert
Posts: 4613
Joined: Wed Mar 24, 2010 5:48 pm
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No

Re: Acorn Macro/ Sub Program to offset wsc Position

Post by cncsnw »

Look up M224 and G92.


kcarpenter1986
Posts: 17
Joined: Mon Aug 24, 2020 6:18 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: Yes
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: No

Re: Acorn Macro/ Sub Program to offset wsc Position

Post by kcarpenter1986 »

Hi
Thank you for that was very helpful and after some searching I have managed to edit another macro do do what I want


I have another question. is there a way to change the icon on the virtual key pad?



my maco for offsetting the y below:

So I set the back left corner of my vice and 0,0 WC3 so i never change this

then when i clamp a block of stock in my vice most of the time i will line it up with the left

I can then run this maco type in the size of the block and it will reset WC2 in the botom left corner of the block

;------------------------------------------------------------------------------
;Macro to take current origin and offset Y by asked amount and reset this as origin 2
;------------------------------------------------------------------------------

IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

N100 ;Insert your code between N100 and N1000
#101 = 1 ;Initialize #101 to 1, (represents axis number)
IF #50010 ;Prevent lookahead from parsing past here

N200 ;If an axis has not been homed, notify user part 0 can not be set.
#102 = #[20100 + #101] ;Set #102 = Ascii value of current axis label
IF #50010 ;Prevent lookahead from parsing past here
IF #102 != 78 THEN #[103 +#101] = #102 ;Put label into appropriate variable
IF #50010 ;Prevent lookahead from parsing past here
IF #102 != 78 THEN #103 = [[#103]+1] ;Increment number of valid axes.
IF #50010 ;Prevent lookahead from parsing past here
IF #102 == 78 THEN GOTO 300 ;Skip if axis label = N
IF #50010 ;Prevent lookahead from parsing past here
IF #[23700 + #101] THEN GOTO 300 ;If current axis has been homed, goto 300 to increment to next axis.
;Otherwise, display message below
M225 #100 "%c axis home is not set.\nPlease home your machine before attempting to set part 0.\nPress Cycle Start to exit and then home all axes." #102
IF 1 == 1 THEN GOTO 1000 ;Go to end of macro. Exit macro

N300 ;Loop through axes to make sure machine is homed
IF #50010 ;Prevent lookahead from parsing past here
#101 = #101 + 1 ;Increment axis number
IF #50010 ;Prevent lookahead from parsing past here
IF #101 < 5 THEN GOTO 200 ;Only need to check 4 axes, go to end
IF #50010 ;Prevent lookahead from parsing past here

G53 Z0

G00 X0 Y0 ; Move to X and Y 0




N400 ; Ask User how much to offset by in the y axis

IF #103 == 3 THEN M224 #110 "Please enter amount to offset Y axis \n Press Cycle Start to complete"
IF #50010 ;Prevent lookahead from parsing past here

N500 ; Move Y axis by offset amount

G00 Y-#110
IF #50010 ;Prevent lookahead from parsing past here

N600 ; swap to origin 1

G55


N700 ;Set Y axis to


G92 X0 Y0






N1000 ;End of Macro


swissi
Posts: 603
Joined: Wed Aug 29, 2018 11:15 am
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DADEB24D5-0309180716
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Acorn Macro/ Sub Program to offset wsc Position

Post by swissi »

kcarpenter1986 wrote: Fri Nov 13, 2020 9:27 pm I have another question. is there a way to change the icon on the virtual key pad?
Lots of great information here:

Introduction to Centroid CNC Macro Programming

Centroid VCP 2.0 Users manual

-swissi
If you are using any Probing Device, a Rack ATC or want a more efficient Work Flow, check out CHIPS

Contact me at swissi2000@gmail.com


Post Reply