A method of compiling a Programmable Logic Controller, PLC, command, the method comprising: choosing one compile processing scheme from a plurality of compile processing schemes for a command contained in a program to be executed in a PLC; and executing a command compile based on the chosen compile processing scheme, characterized in, that the plurality of compile processing schemes include a compile processing scheme for a size and a compile processing scheme for a rate, wherein the choosing comprises: choosing the compile processing scheme for the size when a size of a program in the PLC is over a reference size or when a remaining data storage capacity in the PLC is below a reference capacity, wherein executing the command compile includes: when the chosen compile processing scheme is determined to be the compile processing scheme for the size, executing the command compile in an indirect compile processing scheme by identifying an address of a command processing function stored in a binary file with reference to a command map table optimized for the size, followed by invoking the command processing function, followed by copying the command processing function needed to execute the command into a compile area to identify the address of the command processing function upon driving the PLC, and followed by invoking the stored function to execute the command. choosing one compile processing scheme from a plurality of compile processing schemes for a command contained in a program to be executed in a PLC; and executing a command compile based on the chosen compile processing scheme, characterized in, that the plurality of compile processing schemes include a compile processing scheme for a size and a compile processing scheme for a rate, wherein the choosing comprises: choosing the compile processing scheme for the size when a size of a program in the PLC is over a reference size or when a remaining data storage capacity in the PLC is below a reference capacity, wherein executing the command compile includes: when the chosen compile processing scheme is determined to be the compile processing scheme for the size, executing the command compile in an indirect compile processing scheme by identifying an address of a command processing function stored in a binary file with reference to a command map table optimized for the size, followed by invoking the command processing function, followed by copying the command processing function needed to execute the command into a compile area to identify the address of the command processing function upon driving the PLC, and followed by invoking the stored function to execute the command. choosing the compile processing scheme for the size when a size of a program in the PLC is over a reference size or when a remaining data storage capacity in the PLC is below a reference capacity, wherein executing the command compile includes: when the chosen compile processing scheme is determined to be the compile processing scheme for the size, executing the command compile in an indirect compile processing scheme by identifying an address of a command processing function stored in a binary file with reference to a command map table optimized for the size, followed by invoking the command processing function, followed by copying the command processing function needed to execute the command into a compile area to identify the address of the command processing function upon driving the PLC, and followed by invoking the stored function to execute the command. <EOS>