If anyone wants an easy to use and accurate part counter, try this line of code right above your M30. We use it a lot.
G10 L10 G91 P30 R6;
Did not see this suggestion here anywhere so I decided to throw it out there. "P" is the desired tool offset line you want it to increment your count to and should be a unused tool number. "R" without a decimal point will increment this setting by that specific number ( in tenths) which would be the number of finished pieces produced.
Do not use a decimal in case you need to edit it for some reason and don't want an alarm for the number being to big. In this example, there are 6 finished parts after each cycle.
Use L11 if you prefer it in the "H value" wear column. This also works on Fanuc mills as well. It also works on Brother cnc tapping centers but why bother when those have 4 counters activated by the M211-M214 code or an easy to get to macro variable page where you can use the 500 = #500 + 6 type code.
Hope some of ya can make use of this.