Page 1 of 1

Calculator on the VCP

Posted: Wed Jun 22, 2022 3:27 pm
by suntravel
Played with macros.... :)

Made an M55 macro to calculate Vfc for circular pockets or internal thread milling, for the case I can´t find my calculator :mrgreen:

Replaced code with a correct calculating version and logic for senseless user input :D

Code: Select all

;------------------------------------------------------------------------------
; Filename: mfunc55.mac - To run from VCP AUX 10 key, set p197 = 5511
; M55 macro
; Description: Calculate Vfc for internal thread milling or circ. pockets
; Requires: Machine home must be set prior to use.
; Please see TB300 for tips on writing custom macros.
;------------------------------------------------------------------------------

IF #50010                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
#105=0
N100
M224 #101 "Calculate Vfc for\nint. thread milling\nor circ. pockets\n\nMill Diameter"
M224 #102 "Bore Diameter" 
IF #101 >= #102 and #105 == 0 THEN GOTO 900 ELSE GOTO 110
N110
IF #101 >= #102 and #105 >= 1 THEN GOTO 990 ELSE GOTO 200
N200
M224 #104 "Feedrate Vf"
#103=#104/((#102*3.14)/((#102-#101)*3.14))
M225 #100 "Use for:\nMill Diameter: %f mm\nBore Diameter: %f mm\nFeedrate Vf: %f mm/min\n\nCalculated Feedrate\nVfc= %f mm/min" #101#102#104#103
GOTO 1000
N900
M225 #100 "Mill Diameter = %f\n can not be equal or larger then\nBore Diameter = %f\n\n Back to Start" #101#102
#105=1
GOTO 100
N990
M225 #100 "Really?\nThis will also not fit\n\nMill Diameter = %f\n can not be equal or larger then\nBore Diameter = %f\n\n Back to Start you Stupid" #101#102
GOTO 100
N1000                            ;End of Macro

Re: Calculate Vfc with M55

Posted: Wed Jun 22, 2022 8:43 pm
by johnballard
Humm... in your VCP I see buttons I do not have. The 45's between the X & Y jog buttons and the Axis 0 and All zero. How does the axis 0 work.

Can you share the code for them? Does the code have to be compiled into the PLC program? Do the macros also work on the real CP (aux1, aux2, etc)?

Re: Calculate Vfc with M55

Posted: Wed Jun 22, 2022 9:18 pm
by rk9268vc
johnballard wrote: Wed Jun 22, 2022 8:43 pm Humm... in your VCP I see buttons I do not have. The 45's between the X & Y jog buttons and the Axis 0 and All zero.
He posted about it here
https://centroidcncforum.com/viewtopic.php?f=60&t=7356

and maybe in another thread as well, but cant find it

Re: Calculate Vfc with M55

Posted: Wed Jun 22, 2022 11:09 pm
by suntravel
rk9268vc wrote: Wed Jun 22, 2022 9:18 pm
johnballard wrote: Wed Jun 22, 2022 8:43 pm Humm... in your VCP I see buttons I do not have. The 45's between the X & Y jog buttons and the Axis 0 and All zero.
He posted about it here
https://centroidcncforum.com/viewtopic.php?f=60&t=7356

and maybe in another thread as well, but cant find it
The new buttons are in Acorn 4.79 Beta3.
Available as public download, give it a try, lots of good improvements in there :)

Uwe

Re: Calculate Vfc with M55

Posted: Thu Jun 23, 2022 8:35 am
by suntravel
Message for first and second wrong input in a row :mrgreen:

Uwe

Re: Calculator on the VCP

Posted: Thu Jun 23, 2022 10:26 am
by suntravel
Next two calculators and custom VCP

Quite a good training to make such things....

Uwe

Re: Calculator on the VCP

Posted: Fri Jun 24, 2022 9:30 am
by cnckeith
cool! thanks for posting.

Re: Calculator on the VCP

Posted: Sat Feb 11, 2023 6:19 pm
by ShaAli
Hello, sorry for a dump question, how do I change to macro to be in inches?

Re: Calculator on the VCP

Posted: Sat Feb 11, 2023 6:23 pm
by ShaAli
mm\nBore Diameter:

change them to in ?

in\nBore Diameter:

Re: Calculator on the VCP

Posted: Sun Feb 12, 2023 2:27 am
by suntravel
You can edit the macros to your liking.

Uwe