The Okuma MTConnect adapter usually does a great job of counting parts properly by counting the number of times a part program is run. In most cases a good part count requires no added work, M-codes or macros. If your machine is not counting properly, it may just need a software update.
In some rare cases, the machine may not count properly. If this is the case you can increment by utilizing a common variable on the machine control to count parts instead.
To do this follow these steps:
1) Open up the MTConnect application on your machine's control.
2) Open up the "Device Configuration" page.
3) Select what variable(s) you would like to use for part count.
4) You will need to add a common variable code within your program to increment the part counter. An example of this is VC1=VC1+2 (this will increment Common Variable 1 two parts per count). Add this common variable code near the end of the program for best results.
5) When the common variable code and MTConnect Common Variable settings are finished, you will need to notify MachineMetrics of the variable used so that our configuration can match.