I am making a very modern interface for CNC routing for hobby type users. this is going to be a full replacement for the CNC12 UI but will use all the CNC12 plc and gcode handling.
I am sure I will have many posts here, but here are some initial questions:
I need to be notified about events and movement from the CNC program. These include but are not limited to
- Inputs/Outputs Changing
- current line number of executing program
- x/y/z/a DRO changes
- errors
etc.
I know I can poll for them, but this would create alot of overhead polling every 20ms for every bit of state information.
I message bus or event type mechanism would be ideal where I could register for what I am interested in and get notified when changes are made. I think some sort of granularity is also reasonable (ie, send me new position, but no more than every 50ms)
I cannot see where this exists in the documentation. Any help would be appreciated.
API Questions
Moderator: cnckeith
-
- Posts: 11
- Joined: Thu Aug 14, 2025 3:48 pm
- 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: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
API Questions
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 51
- Joined: Thu Feb 10, 2022 5:55 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
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: API Questions
The next release (v5.40) introduces outbound messages from CNC12 to an API application. The current reported information is the DRO location (given in either local coords, machine coords, or distance to go), shut down and power status, and latest message in the message window.carl@x365.com wrote: ↑Sun Aug 31, 2025 12:30 pm I am making a very modern interface for CNC routing for hobby type users. this is going to be a full replacement for the CNC12 UI but will use all the CNC12 plc and gcode handling.
I am sure I will have many posts here, but here are some initial questions:
I need to be notified about events and movement from the CNC program. These include but are not limited to
- Inputs/Outputs Changing
- current line number of executing program
- x/y/z/a DRO changes
- errors
etc.
I know I can poll for them, but this would create alot of overhead polling every 20ms for every bit of state information.
I message bus or event type mechanism would be ideal where I could register for what I am interested in and get notified when changes are made. I think some sort of granularity is also reasonable (ie, send me new position, but no more than every 50ms)
I cannot see where this exists in the documentation. Any help would be appreciated.
This covers your x/y/z/a DRO changes and errors.
The Inputs/Outputs Changing can be done through a watchlist at present, which is how the PLC diagnostic tool works.
We will be adding more to the outbound part of the API as we go along.
This snippet of code will work with v5.40
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 11
- Joined: Thu Aug 14, 2025 3:48 pm
- 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: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: API Questions
do IO changes appear in message window? I need these to auto match inputs to their use?
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 51
- Joined: Thu Feb 10, 2022 5:55 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
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: API Questions
IO changes do not appear in the message window by default. You would have to edit the PLC to achieve thatcarl@x365.com wrote: ↑Tue Sep 02, 2025 10:31 am do IO changes appear in message window? I need these to auto match inputs to their use?
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 11
- Joined: Thu Aug 14, 2025 3:48 pm
- 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: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: API Questions
two other things that I do not see.
seems options to run commands are MDI and file. Is there a way to run a chunk of GCode? I am going to be taking in the gcode, parsing to break up to handle things like pause/dwell, tool changes and custom M codes. Would be nice to send in a string[] of GCode to execute.
does the listener mechanism notify me what line of gcode is current?
seems options to run commands are MDI and file. Is there a way to run a chunk of GCode? I am going to be taking in the gcode, parsing to break up to handle things like pause/dwell, tool changes and custom M codes. Would be nice to send in a string[] of GCode to execute.
does the listener mechanism notify me what line of gcode is current?
(Note: Liking will "up vote" a post in the search results helping others find good information faster)