The LTB strives to represent the data exchange structure in real systems for operation and control by designing the data flow between the decoupled modules. the other one is referred to as the downstream module. There is one data server along with multiple clients in the distributed messaging environment, an example of which can be found in Figure 3(a). The data server runs as a process, which binds to a socket using the transmission control protocol or interprocess communication, and manages the client connections and data delivery. Data clients are imported as APIs by modules for connecting to the server, pulling in and sending out real-time data as explained in Figure 3(b). Note that the server and clients provide only channels for communications, while it is left to the modules to specify the data formats for data exchange. Data Flow and Program Workflow The LTB strives to represent the data exchange structure in real systems for operation and control by designing the data flow between the decoupled modules. The implemented data flow shown in Figure 4 has the following main paths: ✔✔ The flow begins from static data files defining the test systems and scenarios. ✔✔ The simulator exchanges data with the substation simulators, namely, sensors and automation devices. ✔✔ Measurement data (with realistic errors and delays) flows from sensors to the EMS and control system. ✔✔ Some data, such as the estimated state, also flow from the EMS to the control system. ✔✔ Both set-point signals and control signals flow back to automation devices to close the loop. The LTB relies on the APIs of the distributed messaging server and client for implementing the data flow. The APIs provided by the client allow the module to manage Transparent to the User Module B API for Module A Module A Distributed Messaging Client Distributed Messaging Client API for Module B Distributed Messaging Client API for Module C Distributed Messaging Server Module C (a) (b) figure 3. A distributed messaging environment: (a) an example of logical data streaming between three modules and (b) the actual implementation of the three-module data streaming using the distributed messaging server and client APIs. Visualization Model Parameters Simulation Data Power System Simulator Data Files for Systems and Scenarios Actuation Signals EMS Measurement Data Set Point Signals Sensors Automation Devices Model Parameters Updated Data Files Historian and Archiving Control Signals Control System figure 4. An illustration of the data flow for systemic closed-loop testing. 64 ieee power & energy magazine march/april 2020