How to Design Industrial IoT Systems with DDS and LabVIEW 2017
Written by Angel Martinez Bernal
September 28, 2017
Two years ago I started to work on a really interesting project: "RTI DDS Toolkit for LabVIEW". I was really happy because not only was I familiar with LabVIEW, but I loved working with it. While it was a good opportunity, I had to admit that I was a bit nervous because right before joining the team, I found out that the main developer of the RTI DDS Toolkit for LabVIEW was going to be transitioning to a different department. On top of that, RTI had just won the NI Tools Network Product of the Year award. So, no pressure at all.
Now I was going to be the primary developer on the LabVIEW team. It was important to learn as much as possible from my colleague before she transferred to her new position. We spent a lot of time reviewing the existing project and adding to my knowledge of LabVIEW. After a few months, the transition was complete and I started launching new features and taking full ownership of the project.
Then we received some great news: the RTI DDS Toolkit would be integrated into LabVIEW 2017, the latest edition of the product. How awesome! We worked closely with NI to make this happen and enhance our product to fit NI's requirements. We also grew our team to support the effort – which was really good news!
After a few months we were finished and LabVIEW 2017 was released with the RTI DDS Toolkit integrated! The integration was publicly announced during the keynote presentation at NI Week 2017.
Following the announcement, we've received a few frequently asked questions about DDS and I wanted to answer them all in one place:
"Wait a moment, I'm a LabVIEW user, but can you tell me more about what that DDS thing is?"
DDS is an open standard from the Object Management Group (OMG). It is more than a messaging protocol, it is an interoperable data-centric communication framework for the Industrial Internet of Things (IIoT). For more information about DDS you can visit the OMG DDS website: http://portals.omg.org/dds/what-is-dds-3/
"So this allows me to communicate between LabVIEW applications, right?"
Yes, it does. But not only that, you can also communicate between LabVIEW and other systems without worrying about the operating system or the programming language. You can even connect LabVIEW with legacy systems! And even more, the NI boards using NI Linux can also use this technology (e.g., cRIO 903x and cRIO 906x series).
"What are the main characteristics of the RTI DDS Toolkit?"
RTI DDS Toolkit includes a new, highly configurable data communication paradigm that didn’t exist previously in LabVIEW. It allows N:M communications with security, low latency, reliability and high throughput. The RTI DDS Toolkit in combination with the other communication methods that LabVIEW supports will allow you to face all your networking challenges:
By default, it follows a publish-subscribe communication pattern, where publishers write data to a specific topic. Data consumers subscribe to those topics they are interested in, and then read the data from those topics. Data readers and writers automatically discover each other and exchange data peer-to-peer over the best available communication path, including shared memory, UDP multicast or UDP unicast. Since no network service or message broker is required, this provides a highly scalable and easy-to-deploy solution.
"Ok, this is really useful, but, how can I use the RTI DDS Toolkit in LabVIEW?"
First you will need to install it in LabVIEW. If you are using LabVIEW 2017, you will have a shortcut in the block diagram: select Data Communication, RTI DDS Toolkit, Install, as seen below:
In versions prior to LabVIEW 2017, you can find our toolkit in the LabVIEW Tools Network. You can download it through the VI Package Manager. Look for 'rti dds' in the search box and then click on the 'Install Package(s)' button:
It will launch an installation window from the VI Package Manager. After clicking several times on the 'Next' button, the RTI DDS Toolkit will be installed.
The RTI DDS Toolkit follows the same programming pattern as other LabVIEW APIs:
So the use of the RTI DDS Toolkit is intuitive for LabVIEW programmers.
"What can I find in the RTI DDS Toolkit?"
The version 188.8.131.52 (included in LabVIEW 2017) also includes several tools that help you in the development of your application. Those tools provide an easy way to perform the following actions:
- Debugging applications and find bugs or errors in your VIs.
- Creating security configuration easily.
- Generating custom subVIs for your specific ComplexType.
"Something unexpected is happening in my application, how can I debug it?"
The RTI DDS Toolkit Administration Panel allows you to review the debug messages of your LabVIEW application as well as see a global picture of your system (including the number of entities created, LabVIEW nodes, etc. ). You can also configure some logging parameters on it:
"You also mentioned security, so, how can I secure my data?"
RTI DDS Toolkit can be configured to authenticate, encrypt, and sign your communication using different keys and documents. We provide a Security Panel that eases creation of your desired security configuration. You create 'Secure Profiles' which will be used when creating an entity (data writer or reader). You can also manage these profiles: in the 'Current Profiles' tab, a list of all the created profiles is shown. You can select any profile and load its parameters or delete it:
"I have a complex type, can I use the RTI DDS Toolkit with this type?"
The polymorphic VIs included in the RTI DDS Toolkit support many simple types. If this is not enough, the ComplexType Generator allows you to create your custom subVIs to use DDS for a specific LabVIEW type definition (*.ctl). This ComplexType Generator will generate the following files:
- ComplexType Create Simple/Advanced Reader
- ComplexType Create Symple/Advaned Writer
- ComplexType Read
- ComplexType Write
If Generation of Example VIs is enabled, the following subVIs will also be generated:
- ComplexType Reader Example
- ComplexType Writer Example
All those subVIs will have an input pin whose type will be the type definition (*.ctl file) you have provided before generating those subVIs.
If your type changes, you only have to re-generate the subVIs again (without generating the example VIs). Replace them and your application will have the latest changes.
As you probably know, these panels are supported only on Windows systems. This is because they depend on LabVIEW features that are not supported on RT targets. However, we have added some additional subVIs to replicate the actions from the Administration and Security Panels on RT targets. These subVIs have their own subpalette (DDS Debugging and DDS Security) under the Tools category. For Windows applications, you can use the panels, as well as the created subVIs.
You can find more information about the RTI DDS Toolkit by checking out the following great resources:
- The RTI DDS Toolkit Getting Started Guide
- RTI DDS Toolkit webpage
- The RTI DDS Toolkit forum over on the RTI Community Portal
- NI RTI DDS Toolkit User Guide
You can also register here for our co-hosted webinar, "How to Design Industrial IoT Systems with LabVIEW 2017's Interoperable Data Communication Support" with technical experts from NI. We will cover data communications support in LabVIEW 2017, introduce OPC and RTI DDS Toolkits, compare and contrast OPC UA and DDS standards, and provide guidance on choosing the best solution for architecting your IIoT solution.