How to get WCS axis position in PLC program?

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
ashesman
Posts: 127
Joined: Thu Dec 03, 2020 4:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: none

How to get WCS axis position in PLC program?

Post by ashesman »

I would like to read axis position in the current work coordinate system in the PLC program. I can see special variables for absolute encoder position but none for calibrated WCS position. They are probably right there but my brain is starting to fail me tonight!

The application is: I have three buttons on my control panel Set X0, Set Y0, Set Z0. Each button has a light. I want to light the button for each axis when the machine is at (near) zero relative to the current WCS.

I will only light them in manual mode so they dont flash every time an axis passes 0 while running a program!

example pseudo code:

IF ManualMode && XPos <= 0.002 && XPos >= -0.002 THEN (SetX0ButtonLight_O)
cncsnw
Posts: 2081
Joined: Wed Mar 24, 2010 5:48 pm

Re: How to get WCS axis position in PLC program?

Post by cncsnw »

There are no such variables.

You would have to use some opportunity -- e.g. the running of CNC macros you have mapped to those Aux keys -- to store the WCS zero offsets, perhaps converted to encoder counts, into Machine Parameter values. The PLC program can then read those machine parameters and compare to the current encoder positions.

Of course, the parameters would not be updated when you changed coordinate systems (G55, G56, G57...) without running your set-zero macros again.
ashesman
Posts: 127
Joined: Thu Dec 03, 2020 4:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: none

Re: How to get WCS axis position in PLC program?

Post by ashesman »

Bugger... it seems like a really useful variable to have access to in the PLC program. Could be good for all sorts of things.
Post Reply