5.3 PLC Development


After creating development environment, users can start developing PLC. M4PLC32.CPP can be edited using any kinds of word editor such as Notepad, Word, Wordpad, etc. Please put M4PLC32.CPP in the chosen folder (the folder where PLCM4.zip was unzipped, in this case suppose the name of folder is \PLCM4) after it is finished. Next, follow the steps below to generate M4PLC32.DLM file and then upload the file to the controller.


1.

Key in "cmd" in the dialog box opened from "windows key+R → Execute".



2.

Switch to directory "PLCM4" in M4PLC32.CPP.



3.

Execute the command "mk" to generate M4PLC32.DLM file.

If there are bugs or errors in the M4PLC32.CPP program, the "make" command will not be able to generate M4PLC32.DLM. You must correct your program step by step until there is no error.



4.

Upload file to the controller via FTP, and load it from "Machine parameter → Load M4PLC32.DLM".


M4PLC32.DLM is a dynamic link file for INCON-M84/M86/M86R, and it will link to INCON-M84/M86/M86R CNC system when power on. After uploading M4PLC32.DLM, you must load it form "Machine parameter → Load M4PLC32.DLM". Then, the CNC system will load new M4PLC32.DLM from the \MSYS folder and execute new PLC functions.


5.

After the file is loaded, restart the controller.


Note 1:

The PLC file name must be M4PLC32.CPP. The M4PLC32.DLM file which is compiled must be put in the same folder, to facilitate the maintenance of tracking.

Note 2:

For instructions on how to use FTP to upload the M4PLC32.DLM file, refer to INCON-M84/M86/M86R Integration Manual.