6.5 Data Input to File Application


In some cases, the user needs to collect the data generated by executing the CNC program. For example: teaches the process of entering a workpiece contour. Therefore, the system will need to create a file to store this information. For this requirement, a new set of agreements was added to the PLC communication protocol to handle this work. The new agreement will be described in detail below.


Copy and paste the code in the following example into M4PLC32.CPP to meet this requirement.


This application requires the use of three M codes. In this document, M60/M61/M62 will be used as an example, but users are free to use it. Also note that the three M codes can only be executed by the system's built-in editor and not by the DNC or MDI. If it is not performed by the editor, a false alarm will appear.