This paper presents a data-oriented technique for designing a proportional-integral-derivative (PID) controller based on a generalized predictive control law for linear unknown systems. In several control design approaches, a model-based control theory, which requires accurate modeling and identification of the plant, is used to calculate the control parameters. However, in higher-order systems and/or systems with an unknown time delay such as chemical industries and thermal industries, it is difficult to model or identify the plant accurately. Over the last decade, data-oriented techniques in which the online or offline data are utilized have been attracting considerable attention. Designing the controllers for unknown plants based on only the input/output data is the main feature of this technique. In this study, controller parameters are first obtained by using a generalized predictive control law with the data-oriented technique, and are converted to PID parameters from the practical point of view. The proposed method is validated experimentally using a real injection-molding machine. The results demonstrate the efficiency of the proposed method.