# Development of a Modular Software Architecture for Underwater Vehicles Using Systems Engineering
## 3 Modular Software Architecture Definition
### Software Components Architecture  
A general view of the designed software architecture is displayed by using a modified UML components diagram. Figure 5 represents Pionero500's software component architecture. The design is layered, with top levels being close to the user, and bottom levels addressing low-level signals and devices. The user level defines interactions with users through interfaces. The topside level involves components hosted mostly on the topside computer, where the actor model is implemented. The instrument level regards the vehicle main computer and instruments components. Both the topside and instrument levels' coding language is National Instruments LabVIEW. Finally, the device level comprises firmware components, hosted on SmartCard devices. Further details on SmartCards can be found in [54]. Regarding modularity, components identified with dashed lines are named as additional. This indicates where to include future modules and how they would interact with others in the architecture. For example, an additional actor included in the topside level needs to be launched by ROV_Interface.vi, and communicates through queues with other actors. Figure 4: Deployment diagram specifying relationships between hardware nodes and software components. Similar to the hardware architecture, there are components running in the surface station and others in the ROV. The software architecture is implemented using virtual instruments (.vi) for middle-ware and high-level components, and custom software based on Arduino libraries (.ino) for low-level components. The last example serves as an introduction to the specific implementation of the actor model in this architecture. As mentioned in Section 2.5, actors essentially need to be independent and a communication channel. Considering this, the development team created its own implementation of an actor-based model in LabVIEW, as third-party approaches added unnecessary complexity to the solution. LabVIEW queues served as communication channels, as they offer asynchronous lossless message exchange, in a first-in first-out (FIFO) manner. Each actor must be created with its own queue, which also must be accessible to every other actor and the actor launcher. For actor execution and termination, the main interface application ROV_Interface.vi serves as launcher, by running each actor VI using LabVIEW asynchronous VI execution. When running, each actor's specific user interface, also known in LabVIEW jargon as a front panel, can be accessed through the launcher's front panel. This feature enables modular and concurrent user interface development, as each actor's interface can be modified simultaneously without modifying the launcher's front panel. Essential actors include COM.vi, which handles communication between topside and instrument level; CI.vi, named after Command Interface, which contains indicators and controls needed for human-machine interaction, and also establishes communication with the ROV command peripherals controller, in this case, an NI MyRIO. Non-essential actors implemented can be removed without affecting basic operation of the whole system,  
Figure 5: Component architecture for the ROV Pioneo500. The topside and user levels run in the surface station, while the instrument and device levels run on the ROV. Dashed lines correspond with potential components that can be connected to the software. although it involves removing useful features such as instrument data acquisition (DAQ.vi) and mission data storage (DB.vi). Each actor can interact with multiple external third-party applications. One implementation of this feature is the data acquisition actor DAQ.vi, which establishes communication channels with topside instrument's own applications, e.g., Ultra Short Baseline (USBL) server or Global Positioning System (GPS) serial data. Regardless of the application, DAQ.vi obtains, processes, and distributes data to other actors or external applications.