Controlling Multiple Outstations for Smart Buildings with DNP3 in Real-Time

Jesús Hidalgo, Endeavour Consult C.A.

"Working with NI support and R&D allowed us to use a CompactRIO target as a master controller and avoid secondary devices for the DNP3 protocol, which translated into saving around $500 USD worth of hardware and installation costs for each outstation."

- Jesús Hidalgo, Endeavour Consult C.A.

The Challenge:

Monitoring and controlling multiple medium voltage disconnect switches for smart buildings with several PCs as Human Machine interfaces (HMI) and a National Instruments CompactRIO controller configured as a Distributed Network Protocol (DNP3) master.

The Solution:

Improve the existing LabVIEW DNP3 libraries to use a CompactRIO controller as a master of multiple automated medium voltage disconnect switches (DNP3 outstations) with an optimized use of memory performance, and real-time interaction with several PC based HMIs over TCP/IP networks.


Jesús Hidalgo - Endeavour Consult C.A.
Héctor Rojas - SIDEV



Endeavour Consult C.A. (established in 2008) is a NI Alliance Partner company, based in Caracas, Venezuela. It is dedicated to developing instrumentation and control solutions with expertise in the oil midstream and energy industry sectors, and also has a growing potential for developing solutions for smart building applications. Through NI’s Alliance Partner network, Endeavor Consult joined forces with SIDEV, an NI Alliance Partner from Mexico to create the solution the end customer required for this project.

Today, a new smart building generation has arisen requiring operational systems with more instantly accurate, interactive, processed information about their systems, such as power distribution, water distribution, fire protection, heating, ventilation and air-conditioning (HVAC), vertical transportation, security, illumination, and so on. The challenge is to provide the best experience while minimizing energy consumption as much as possible for owners, tenants and maintenance managers. Aligned with this world’s on-the-go improvements, the end costumer for this project was required to monitor and control eleven medium voltage disconnect switches from three different control rooms with Windows PC desktops, but a real-time application was necessary. These disconnectors can communicate over an Ethernet local network with Distributed Network Protocol v.3 (popularly known by the acronym “DNP3”), and TCP/IP protocols (See Figure 1).


The customer’s interest about this requirement is a clear step towards turning their facility into a smart building. Its success would open doors to progressively implement new control and monitor processes related to energy quality and consumption. Also, it would be an example for nearby new customers that can benefit from this solution with an even shorter development time. National Instruments’ technology was selected because of its high-level programming language, LabVIEW, which offers fast development time and a vast library for communications with multiple protocols as DNP3 or ModBus.


System Overview

The application must connect, in real time, three simultaneous human-machine interfaces (Windows desktop PCs), with eleven medium voltage automated disconnect switches (outstations), while showing to the user more than 900 binary and analog signals (see Figure 2 and Figure 3), and controlling the binary state of some of them. Error logs register any kind of application deviation from its normal behavior and each one of the user changes to the binary states. Any work station is being able to read and control any outstations but only one HMI can change binary states at a time, to prevent user-introduced race condition problems. A cRIO-9063 controller is the master that connects each HMI to each outstation. NI PSP-Shared variables protocol has been selected to communicate the HMIs with the cRIO controller, and DNP3 is the communication protocol between the controller and outstations. The code should be modular enough to allow in the future communications with other devices using ModBus RTU protocol.


The main embedded application was built with several subVIs that independently handle errors, logDNP3 communications. The architecture is modular so it can allow future communications with new devices via other protocols as Modbus. Producer-consumer queue messages exchange information between all main subVIs and the decides if a safety shutdown of the application is necessary, using a user event structure to stop all subVIs as shown in Figure 2.

Because the disconnect switches are already installed and working, the commissioning time is very short and minimal adjustments to the code should be made. There is no space for any control error, thus, a complete simulation of outstations enabled test conditions during all design stages. This simulation code can run only in a LabVIEW environment.


The customer outstations energize all facilities electrical equipment and devices, including water supply, and HVAC services. For this reason, the National Instruments CompactRIO platform was selected as the master controller, as it satisfies IEEE standards to be as reliable as their outstations. Furthermore, a powerful software is required to easily integrate several protocols and communication structures (see Figure 4) to allow simultaneous tasks, and even compiling the HMI application to a Windows environment. Another important LabVIEW feature is its graphically easy way to comment and identify the code, which allows engineers speaking Spanish, English or Chinese to understand, evaluate and improve the code.


The NI ecosystem was the key to improve the memory use of the CompactRIO controller, and to adjust the DNP3 libraries to handle all possible error signals coming from DNP3 outstations. NI support engineers made advanced suggestions to optimize the memory space required.


Solution Results and Beyond

Working with NI support and R&D allowed us to use a CompactRIO target as a master controller and avoid secondary devices for the DNP3 protocol, which translated into saving around $500 USD worth of hardware and installation costs for each outstation.


The DNP3 is a protocol extensively used by water and energy companies and offers more features than other industrial protocols making it reliable, robust and efficient, but with higher code complexity. This solution expands the NI ecosystem opportunities to solve new challenges at those industries using architecture like this, without the need to integrate additional hardware resources, and working only with LabVIEW as a development environment.


Author Information:

Jesús Hidalgo
Endeavour Consult C.A.
Edif. El Saman 12C, Calle B
Tel: +58 412-262-0000




An NI Partner is a business entity independent from NI and has no agency, partnership, or joint-venture relationship with NI.

Figure 1. Main solution diagram
Figure 2. Screenshot from HMI interface start page
Figure 3. Screenshot from disconnect signals state HIM main page
Figure 4. Main application diagram structure