Paste DRO Value

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
brittfussel
Posts: 44
Joined: Fri Oct 19, 2018 5:47 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Paste DRO Value

Post by brittfussel »

In July 2022, I made a post regarding wanting to take a value from a DRO, doing some math on it, and placing the resulting value in the field for the part location. (The original post can be found here: https://centroidcncforum.com/viewtopic. ... dro#p66393) A suggestion was made to write a macro and activate it from the VCP for each of the axis. Sounds well and good but I'm not a programmer (although I did to learn to program in Fortran while working on an engineering degree in the mid 1970s). My assumption is that there is a PLC variable that contains the value displayed in the various DRO fields and that I could take that value, do some math on it (i.e. divide by 2), and then place it in the variable for the location of the work coordinates. I scanned through the Centroid CNC PLC and CNC Function Programming Manual but such a variable name did not readily jump out at me. Am I correct in my simple view as to how to do this? If so, what variable name(s) should I be looking for? Has somebody already done this and can share their macro with me? Thank you for your time.


Britt
cnckeith
Posts: 7554
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: Paste DRO Value

Post by cnckeith »

macro programming is pretty straight forward, if i understand what you are looking to do the macro suggestion would work, i've asked Domenic in tech support to help you out, in the mean time the manual you want to read is
https://www.centroidcnc.com/centroid_di ... amming.pdf

and if you want to assign your to a button.
https://www.centroidcnc.com/centroid_di ... manual.pdf
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
centroid467
Posts: 317
Joined: Thu Apr 14, 2022 2:46 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

Re: Paste DRO Value

Post by centroid467 »

I think they meant a macro using G and M codes. This would be relatively simple and all the information you need to write the macro itself is in the mill operator's manual. A list of variables is given on page 192 in the mill manual and a similar table is in the lathe manual. Immediately following the table is a macro writing tutorial. There is also this macro programming introduction: https://www.centroidcnc.com/centroid_di ... amming.pdf

To get you started:
Variables #2400 to #3218 let you access the WCS table values. #5021 - #5028 give the current position in machine coordinates. #5041 to #5048 are equivalent to the DRO reading and are referenced to the current WCS.
I would look at the VCP User Manual to make it run at the press of a button. Page 33 seems to be the start of the relevant stuff.

edit: Ooops, took too long to write the response. I'll let Domenic take over.
dpascucci_support
Posts: 93
Joined: Thu Sep 21, 2023 9:24 am
Acorn CNC Controller: No
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: none
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

Re: Paste DRO Value

Post by dpascucci_support »

centroid467 hit the nail on the head, #5041-5048 are the system variables that let you access each axis's DRO reading (cf pg 193 in the mill manual). You can copy those values over to a user variable, and do whatever operations you want on them.
When you say "place the resulting value in the field for the part location" is it correct to assume you mean the WCS coordinates that define the 0 locations for each axis in relation to the material? If so, those system variable locations are #2500-#2518, #2600-#2618, etc (cf pg 192 in the mill manual) and are readable/writable so they can be updated with the values you calculate.
Domenic

When requesting support READ THIS POST first.

Please ALWAYS post a FRESH report.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)
brittfussel
Posts: 44
Joined: Fri Oct 19, 2018 5:47 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Paste DRO Value

Post by brittfussel »

cnckeith, centroid467 and dpascucci_support

Thank you for the quick response. This is exactly the information I was looking for. I'll take a look a the referenced pages of the operator's manual and try to write a macro that can be called from the VCP.

Thanks again.


Britt
Post Reply