## 5 Discussion
It is expected that this approach would result in improved quality and a significant reduction in the cost and time required to validate a system. This is corroborated by [26], who displayed how automated testing with MBD resulted in increased test coverage compared to manual methods in an industrial project to develop a spatial frequency sensor system, and [59], who reported that the use of MBD for testing and documentation during the development of rail propulsion systems resulted a cost reduction of 45%. Another benefit to this approach is the capability to automatically rerun the initial test scripts following an update to ensure that the original functionality has not been affected by the addition of new features and is still performing as specified. This has the potential to enable equipment designers to adopt an agile approach to equipment design by creating standard function blocks which can have additional features added in future as per user desires. Although MBD has previously been used to generate PLC code for industrial equipment in [36], there is little evidence in the literature to suggest that the use of MBD to develop and validate equipment software has been considered by manufacturers of equipment for regulated environments. This paper aimed to address this gap in the literature by presenting a novel approach to the design and validation of custom software for equipment control. This was accomplished by leveraging the capabilities of MBD to automate the testing, documentation and code generation steps in equipment design and applying this approach to a common industrial application. It is expected that this work will provide a basis for demonstrating the benefits of adopting model-based practices to equipment manufacturers in regulated industries. The successful operation of the PLC code for the test case examined in this paper verified that the simulation model and results accurately represented the physical system, proving that the proposed approach is a viable method to produce validated equipment control logic. Although the Simulink PLC code presents the opportunity to generate code automatically for multiple technology provider platforms and, in principle, enables a technology provider agnostic approach to equipment design, some considerations for the target hardware are required. The design engineer requires a detailed understanding of the PLC platform or equipment on which the code will run, as many PLC environments include libraries of function blocks that perform similar functions but receive and process data in slightly different manners. This is a potential barrier to adoption of the approach in an industrial environment, due to the requirement for model-based definitions of the technology provider specific function blocks, such as the MAM block developed in this work. A significant modelling effort would be required to generate accurate model-based definitions of all commonly used function blocks for different PLC platforms, and this is unlikely to be feasible for a single manufacturer. However, the potential benefits of adopting a MBD approach to validation, including automated requirements testing, automated software verification, automated documentation and code generation, indicates that the creation of these models would improve validation activities across the regulated industry and warrants further research to enable this approach, perhaps adopting an all-industry approach where technology providers provide their function block models in accordance with standards, such as PLC Open.