## 1 Introduction  
Development of cyber-physical systems is a complex discipline that includes many activities, e.g., system design, specification of required properties, implementation, testing and further development of the system [1]. These operations are important for the final product, therefore it is necessary to create a model of the system first [2; 3]. Development of control methods for discrete-event and hybrid systems belongs to modern trends in automation and mechatronics. Hybrid systems in manufacturing processes combine time-driven and event-driven in automotive industry. Control of such systems is challenging due to the necessity to apply control methods both for discrete-event systems (where the Petri nets formalism can be helpful) and standard continuous-time control methods (e.g., PID (proportional-integral-derivative) algorithms) [4]. With an appropriate software development methodology, and software and hardware modules, these control methods can be synergistically combined to yield a proper and unique control system that allows joining discrete-event and continuous-time control methods for an effective hybrid systems control. This is useful in systems which require using different control algorithms depending on the state of the system--for example proportional-integral-derivative (PID) controllers with different parameters. Using the Petri nets concept, these control rules can be managed in a very efficient, robust and visual way. In this article, new Petri net tools for modeling and control of discrete-event and hybrid systems are developed. Case studies dealing with control of a laboratory fire alarm system and a DC (Direct Current) motor are included. During the research, it was necessary to look for projects and papers on modeling and control of discrete-event or hybrid systems using high-level Petri nets. An important point was to find out whether the existing research projects dealt just with the theory, or some open-source software tools to support modeling and control using high-level Petri nets were used or directly developed. For practical outcomes of the presented research it would be beneficial to find the latter type of research projects. In papers [5; 6] authors deal with usage of hybrid and color Petri nets for modeling traffic on crossroads and on highways. From these authors, there are also interesting projects in the field of manufacturing systems [7; 8]. Unfortunately, it is not mentioned whether the results are only theoretical models, or they have been simulated using a SW (software) tool, or deployed in practice. An interesting software tool named Visual Object Net++ that supports hybrid Petri nets was developed in [9]. There are a lot of papers mainly from an author of [10; 11] describing capabilities of Visual Object Net++. However, this tool is not open-source and has not been further developed. A SW tool Snoopy [12] offers modeling based on many Petri nets classes like stochastic, hybrid, color, music Petri nets, etc. Using this tool, many types of research in biology and chemistry are being solved. Unfortunately, the source code is not available. Colored Petri nets are used for modeling of automated storage and retrieval systems in [13; 14]. An interesting open-source Matlab tool for modeling with timed discrete, continuous and hybrid Petri nets is HYPENS [15]; however, it is no longer available for download. As described therein, a Petri net model in HYPENS can be defined only using matrices, graphical representation is not supported. This fact eliminates one of the advantages of Petri nets, support of newer versions of Matlab is questionable as well. GPenSIM is a tool for modeling and simulation of discrete-event systems [16]. It offers many options for simulation and analysis of Petri net models. A big advantage is the support of timed Petri nets [16; 17]. In the paper [18], GPenSIM is used for modeling of a flexible manufacturing system but not for its control. As in the previous case, the Petri net is represented only by matrices and cannot be defined graphically.