A motion control program for execution by a computer for performing motion control of a control target device, the computer having a non-real-time OS and a real-time OS installed thereon, wherein, when executed by the computer, the motion control program causes the computer to function as: a reception unit operating on the non-real-time OS; a queue generation unit operating on the real-time OS; a storage unit operating on the real-time OS; a command processing unit operating on the real-time OS; and a fixed-cycle processing unit operating on the real-time OS; wherein the reception unit gives a second instruction, when receiving a first instruction to reserve a memory area for a FIFO queue from a user-created program for controlling the control target device, wherein the first instruction includes an indication of a first identifier corresponding to a FIFO queue to be created, and wherein the second instruction is an instruction to the queue generation unit to reserve the memory area for the FIFO queue corresponding to the first identifier, the queue generation unit reserves, when receiving the second instruction from the reception unit, the memory area for the FIFO queue corresponding to the first identifier in a memory area on the real-time OS, the reception unit receives a control command indicating an operation that should be performed by the control target device over a plurality of motion control cycles and a second identifier indicating a FIFO queue in which the control command is to be queued, from the user-created program; and stores control command information indicating a content of the received control command, and the second identifier, in a control command channel which is reserved in a shared memory referable from the non-real-time OS and the real-time OS; the storage unit obtains the control command information from the control command channel and stores the obtained control command information in the FIFO queue corresponding to the second identifier; the command processing unit performs retrieval processing of retrieving the control command information from the FIFO queue corresponding to the second identifier and passing it to the fixed-cycle processing unit; and the fixed-cycle processing unit transmits to the control target device for each of the motion control cycles an interpolation command indicating an operation that should be executed for each of the motion control cycles, based on the control command information passed from the command processing unit, thereby performing motion control of the control target device. a reception unit operating on the non-real-time OS; a queue generation unit operating on the real-time OS; a storage unit operating on the real-time OS; a command processing unit operating on the real-time OS; and a fixed-cycle processing unit operating on the real-time OS; wherein the reception unit gives a second instruction, when receiving a first instruction to reserve a memory area for a FIFO queue from a user-created program for controlling the control target device, wherein the first instruction includes an indication of a first identifier corresponding to a FIFO queue to be created, and wherein the second instruction is an instruction to the queue generation unit to reserve the memory area for the FIFO queue corresponding to the first identifier, the queue generation unit reserves, when receiving the second instruction from the reception unit, the memory area for the FIFO queue corresponding to the first identifier in a memory area on the real-time OS, the reception unit receives a control command indicating an operation that should be performed by the control target device over a plurality of motion control cycles and a second identifier indicating a FIFO queue in which the control command is to be queued, from the user-created program; and stores control command information indicating a content of the received control command, and the second identifier, in a control command channel which is reserved in a shared memory referable from the non-real-time OS and the real-time OS; the storage unit obtains the control command information from the control command channel and stores the obtained control command information in the FIFO queue corresponding to the second identifier; the command processing unit performs retrieval processing of retrieving the control command information from the FIFO queue corresponding to the second identifier and passing it to the fixed-cycle processing unit; and the fixed-cycle processing unit transmits to the control target device for each of the motion control cycles an interpolation command indicating an operation that should be executed for each of the motion control cycles, based on the control command information passed from the command processing unit, thereby performing motion control of the control target device.