M17

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

Moderator: cnckeith

Post Reply
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

M17

Post by martyscncgarage »

Atrump Maximill with a tool changer
Upgraded control from a CPU10 system.
The OLD M17 from the CPU10 System with a DC3IO:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; File: cnc10.m17
; Custom M6 pre-posted command used
; with atc2/arm2
;
m5 ; turn off spindle and orient commands
m9 ; turn off coolant
m3 s300 ;
g4 p.25 ; delay time to allow a turn
m94/11 ; turn on M19 (Orient Spindle) output

The new CNC12 system does not have an M17 Macro, I discovered this when using Intercon yesterday.
The ATC is working. M19 is functioning.

Parameter 162 is set to 17 so Intercon is posting the M17 Macro. Since it did not exist, getting errors when Graphing the part.

In the new system, is M17 Needed? Or is it good practice to have and what should it look like? Seems to me that M5 and M9 are all that are needed?
Attachments
report_0008DC111213-0322210016_2021-07-22_12-57-05.zip
(650.72 KiB) Downloaded 85 times
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: M17

Post by cncsnw »

You use M17 to do anything you want to do, starting at the end of the last cut before a tool change.

Turning off the spindle and coolant is typical, but the main reason for having it at all is to get a head start on spindle orientation.

That allows the spindle to orient while Z moves up to the tool change position, as long as your PLC and spindle drive can manage orientation themselves, without babysitting from code in the CNC macro.
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: M17

Post by martyscncgarage »

cncsnw wrote: Fri Jul 23, 2021 1:26 pm You use M17 to do anything you want to do, starting at the end of the last cut before a tool change.

Turning off the spindle and coolant is typical, but the main reason for having it at all is to get a head start on spindle orientation.

That allows the spindle to orient while Z moves up to the tool change position, as long as your PLC and spindle drive can manage orientation themselves, without babysitting from code in the CNC macro.
Thank you Marc,
So then I could simply reuse the old M17 Macro (Renaming it mfunc17.mac) and changing the M94/11 to the current Orient Output which is Output 10.
Would that be correct?

Marty

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; File: cnc10.m17
; Custom M6 pre-posted command used
; with atc2/arm2
;
m5 ; turn off spindle and orient commands
m9 ; turn off coolant
m3 s300 ;
g4 p.25 ; delay time to allow a turn
m94/11 ; turn on M19 (Orient Spindle) output
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: M17

Post by cncsnw »

Make sure you are clear on the difference between PLC output relay numbers, and M94/M95 M-function request numbers. They are not the same thing.
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: M17

Post by martyscncgarage »

cncsnw wrote: Fri Jul 23, 2021 2:50 pm Make sure you are clear on the difference between PLC output relay numbers, and M94/M95 M-function request numbers. They are not the same thing.
I am not clear. Could you elaborate?
Marty
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: M17

Post by cncsnw »

OUT10 is a PLC hardware output. In this case (Hickory) it is an open-collector output, but it might just as well be a relay. It is entirely up to the PLC program logic to decide when to turn it on and off.

M17 and M19 are M function macros, found in CNC G code files with names like "mfunc17.mac" and "mfunc19.mac", and callable from other CNC program files with M codes such as "M17" and "M19". Any given M function macro might or might not interact with the PLC, depending on what its job is.

SV_M94_M95_1, SV_M94_M95_11, SV_M94_M95_19 etc. are "M function request bits". These are one-bit request flags that provide a way for CNC codes (such as those file in an M function macro file) to communicate with the PLC program. On the CNC side, they are turned on and off with the M94 and M95 codes. There are 128 of them, numbered and named 1 through 128.

For example, SV_M94_M95_1 is the spindle run-forward request. The built-in M3 function that is hard-coded into CNC12, and also most custom M3 macro files, will use "M94/1" to turn on the spindle run-forward request. Similarly, an M4 or M5 -- whether built-in or custom -- would use "M95/1" to turn off the run-forward request. The effect of those M94 and M95 codes is to cause the SV_M94_M95_1 bit to be turned on and off in the PLC program. To make it somewhat intuitive, most PLC programs give the name "M3" or "M3_SV" to SV_M94_M95_1.

Very old PLC programs and M function macros -- carried over from the days when there were only 16 request bits instead of 128 -- might use request #11 for spindle orientation. In that case, an M19 macro might send its request via "M94/11", which the PLC program would receive in SV_M94_M95_11 (a bit that the PLC program probably names "M19"). The PLC program would then decide, based on that bit plus any other enabling or inhibiting logic, to turn on a hardware output that happens to be wired to the Orient request on the spindle drive. That hardware output might or might not be OUT10. It could be any available hardware output, as long as your wiring matches your PLC definitions.

The point is that the number of the M function; the number of the request bit; and the number of the hardware output are different things, and there is no reason to believe they should all be equal.

In recent practice (since the number of request bits was expanded to 128, and excluding the long-standing definitions for M3, M4, M7, M8 and M10) it has been conventional that, if the main job of a CNC M function is to send a request to the PLC, to use a request bit number that matches the M function number: e.g. an M19 spindle-orient macro would now typically use M94/19, going to SV_M94_M95_19, instead of M94/11. But that is just a convention, not a requirement.

There has never been, and never should be, a direct mapping between request numbers and hardware outputs. If you decide to wire the orient request to OUT17 instead of OUT10, you should not have to change anything in the CNC macro, and the only thing you should have to change in the PLC program is in the Output Definitions section, where you choose which hardware output you want to name "OrientRequest_O".

Many beginners think that "M94/10" should somehow turn output relay #10 on, without involving the PLC program. The control doesn't work that way.
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: M17

Post by martyscncgarage »

To bring this to closure,
It is my understanding that CNC11/CNC12 systems do not need the M17 Macro as its built into the M6 Macro.
So to keep from an M17 posting in Intercon, I set parameter 162 to 0 instead of "17"
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
Post Reply