1. A control device for controlling a control object apparatus comprising: a task execution unit configured to execute a task including a program; a storage unit configured to store a global variable capable of being referenced and updated in the program and reference data corresponding to the global variable; a collection unit configured to collect the global variable when the task including the program is executed by the task execution unit; and a reference data management unit configured to manage reference data stored in the storage unit, wherein the task execution unit is configured so as to execute a plurality of the tasks in parallel with one another, with each task of the plurality of tasks being executed in cycles based on each task, the plurality of tasks include an update task capable of updating and referencing the global variable and a reference task capable of referencing the reference data, the reference data management unit is configured so as to alter the value of reference data to the value of the global variable, prior to executing the reference task, and the collection unit is configured to collect the reference data when the plurality of tasks are executed by the task execution unit.