## 1 Introduction  
Petri nets (_PNs_) is a family of mathematical models that have been extensively used for representing and analyzing systems that evolve through the occurrence of events named discrete event systems [1; 2; 3]. Applications include the analysis of traffic [4], risk assessment [5], biological systems [6], logistics [7; 8], and manufacturing systems [9], among others. One application of _PNs_ that has received a lot of attention in the literature is the design of control algorithms for manufacturing systems. The most common approach consists of the design of places (monitors) that control the firing of transitions, in order to impose a requirement described as a linear inequality, named generalized mutual exclusion constraint (GMEC) [10; 11; 12; 13]. These constraints are useful to enforce safety specifications, avoiding states when two or more processes use the same resource. This control technique has also been extensively investigated to avoid blocking states in particular classes of _PNs_ (see, for instance, [14; 15; 16; 17]). A recent survey on the control of _PNs_ can be found in [18]. _Regulation control_[19; 20; 21] is a different control paradigm, the objective of which is to design controllers that impose sequences of sensors and actuators activation. In detail, the system to be controlled, named Plant, is modeled as an Interpreted Petri net (_IPN_), which is an extension of _PNs_ with labels associated with places (representing sensors) and transitions (representing actuators). The required behavior is described as an _IPN_ as well, named Specification, representing required sequences of sensors and actuators. Then, a controller is designed as an _IPN_ that enforces the Plant to evolve according to the given Specification. Common problems in automation systems, where the engineer requires to program a routine so the Plant describes a required operations sequence, can be addressed by this approach. The advantage of using this scheme is that the engineer only specifies the required tasks in a high-level description; next, the controller can be automatically generated by using the algorithms that have been developed for this purpose [19; 20; 21]. Furthermore, once the _IPN_ controller is designed, it can be automatically translated into programmable logic controller (PLC) code for implementation. In order to perform a practical implementation of the regulation control approach, we have developed a MATLAB(r) app named _RCPetri_[22], which is described in this work. The app was designed to help the user to design and implement regulation controllers by following a control design workflow. In a first step, the app allows us to define an \(IPN\) that represents the Plant in a graphical way. Next, the user can define the required behavior in high-level fashion by using standard Excel tables, which are automatically translated by the app to an \(IPN\) Specification. Later, the controller can be automatically generated. Furthermore, the closed-loop system can be simulated to verify the behavior of the Plant under control. Moreover, the \(IPN\) controller can be automatically translated into PLC code, for its final implementation. Furthermore, a communication module has been implemented, which allows synchronization with other software or hardware through protocols Modbus Internet Protocol Suite (Modbus TCP/IP) and object linking and embedding for process-control-unified architecture (OPC UA). In order to illustrate the use of the app for the synthesis of controllers and their application, three examples are described, as follows:  
1. An electro-pneumatic arm that can perform four different tasks, whose controller is implemented in a PLC;
2. A process control system simulated in a supervisory control and data acquisition (SCADA) software synchronized to the app via Modbus TCP/IP;
3. A manufacturing system with two robotic cells, simulated in a dedicated software and synchronized to the app via an OPC UA server, under a decentralized control scheme.