A computation unit of a programmable logic controller configured to execute a motion control and a sequence control, the computation unit comprising: a processor; and a memory (104, 106), wherein a program for performing the motion control using a CAM table (520, 570, 570A) in which a displacement of a driven shaft of an electronic cam is associated with each phase of a main shaft of the electronic cam, and a first CAM table and a second CAM table serving as the CAM table (520, 570, 570A) are stored in the memory (104, 106), wherein the memory (104, 106) comprises a nonvolatile memory and a volatile memory, and the nonvolatile memory stores the first CAM table and the second CAM table, and wherein the processor is configured to: execute the program using the first CAM table, and output the execution results to an apparatus to be controlled associated with the driven shaft, switch, when receiving a predetermined instruction during the execution of the program, the CAM table (520, 570, 570A) used in the execution of the program from the first CAM table to the second CAM table, output the execution results of the program using the second CAM table to the apparatus to be controlled after the switching; and wherein, when switching the CAM table (520, 570, 570A) used in the execution of the program from the first CAM table to the second CAM table, the processor starts the operation using the second CAM table from a phase in the second CAM table that is the phase following the phase in the first CAM table at the time of switching, wherein the memory (104, 106) further stores an upper limit value related to acceleration and an upper limit value related to deceleration, and the processor is configured to: limit the acceleration of the apparatus to be controlled to the upper limit value related to acceleration when the acceleration of the apparatus to be controlled immediately after the switching is greater than the upper limit value related to acceleration, and limit the deceleration of the apparatus to be controlled to the upper limit value related to deceleration when the deceleration of the apparatus to be controlled immediately after the switching is greater than the upper limit value related to deceleration. a processor; and a memory (104, 106), wherein a program for performing the motion control using a CAM table (520, 570, 570A) in which a displacement of a driven shaft of an electronic cam is associated with each phase of a main shaft of the electronic cam, and a first CAM table and a second CAM table serving as the CAM table (520, 570, 570A) are stored in the memory (104, 106), wherein the memory (104, 106) comprises a nonvolatile memory and a volatile memory, and the nonvolatile memory stores the first CAM table and the second CAM table, and execute the program using the first CAM table, and output the execution results to an apparatus to be controlled associated with the driven shaft, switch, when receiving a predetermined instruction during the execution of the program, the CAM table (520, 570, 570A) used in the execution of the program from the first CAM table to the second CAM table, output the execution results of the program using the second CAM table to the apparatus to be controlled after the switching; and wherein, when switching the CAM table (520, 570, 570A) used in the execution of the program from the first CAM table to the second CAM table, the processor starts the operation using the second CAM table from a phase in the second CAM table that is the phase following the phase in the first CAM table at the time of switching, wherein the memory (104, 106) further stores an upper limit value related to acceleration and an upper limit value related to deceleration, and the processor is configured to: limit the acceleration of the apparatus to be controlled to the upper limit value related to acceleration when the acceleration of the apparatus to be controlled immediately after the switching is greater than the upper limit value related to acceleration, and limit the deceleration of the apparatus to be controlled to the upper limit value related to deceleration when the deceleration of the apparatus to be controlled immediately after the switching is greater than the upper limit value related to deceleration. limit the acceleration of the apparatus to be controlled to the upper limit value related to acceleration when the acceleration of the apparatus to be controlled immediately after the switching is greater than the upper limit value related to acceleration, and limit the deceleration of the apparatus to be controlled to the upper limit value related to deceleration when the deceleration of the apparatus to be controlled immediately after the switching is greater than the upper limit value related to deceleration.