Professional Documents
Culture Documents
A Practical Guide For Connecting LabVIEW To The Industrial IoT - National Instruments
A Practical Guide For Connecting LabVIEW To The Industrial IoT - National Instruments
A Practical Guide For Connecting LabVIEW To The Industrial IoT - National Instruments
Overview
In this white paper, learn about the three most prevalent communication protocols to connect to cloud-based development
platforms for Internet of Things (IoT) applications. You can also find information on some of the most common IoT cloud
development platforms such as Amazon Web Services, IBM Bluemix, PTC ThingWorx, and Microsoft Azure. Plus, learn how to
connect an NI embedded system, such as CompactRIO, to these cloud platforms through the LabVIEW open graphical
development environment.
Table of Contents
1. The IoT Will Change the World
2. MQTT
3. AMQP
4. DDS
5. Amazon AWS IoT
6. IBM Watson IoT for Bluemix
7. PTC ThingWorx
8. Microsoft Azure IoT Suite
Figure 1 – Common Architecture of the Industrial IoT: Intelligent Edge Nodes Connect Sensors, Actuators and Devices
to IT Systems
Because of the decrease in cost of connectivity, processing devices and sensors adoption of IIoT has grown
tremendously. Sensor data can be captured and preprocessed close to the machines by a smart edge device such as a
CompactRIO or a PXI automated test system. The edge device can send the data in real time to the virtual world (IT
cloud platform) where it can be stored, monitored, and analyzed or trigger an action.
The value of the IIoT is not in the connectivity of the devices, but in what a company unlocks from the stream of data the
smart devices supply. Cloud computing platforms and their services help provide this insight.
Many significant challenges need to be taken into account when implementing an IoT solution. Challenges such as
standardization, interoperability, Big Analog Data™ handling, security, and privacy. It is important to be aware of these
challenges and give special care to security. Security is a crucial component for any IoT application. IIoT devices should
enforce a strong security policy and be updated regularly with the latest security patches. To learn more about best
practices for security on CompactRIO and receive the latest security announcements from NI, visit
ni.com/support/security (http://www.ni.com/support/security). All cloud computing platforms securely send and receive
data, use strong authentication and authorization methods, and use encryption. The majority also have audit capabilities.
Cloud Computing
Cloud computing refers to a flexible way of delivering hardware, software, or data resources via the network on a user’s
request. This is opposite to the use of running a software application on a local computer.
http://www.ni.com/white-paper/53954/en/ 1/7
7/22/2017 A Practical Guide for Connecting LabVIEW to the Industrial IoT - National Instruments
The table below shows three service levels of cloud computing that are commonly encountered.
SaaS Software as a Service Provides a full business service. The service provider runs and manages
the complete platform. Examples: Gmail, Salesforce.com
PaaS Platform as a Service Provides a platform. You need to build and deploy your own cloud applic
ation, leveraging the run time and services the vendor provides. Exampl
es: IBM Bluemix, Microsoft Azure, AWS IoT
IaaS Infrastructure as a Service Provides the basic building blocks such as server hardware, storage, an
d network capabilities. You may need to install the OS and applications.
Examples: Amazon EC2 (a virtual machine that Amazon provides to yo
u), IBM SoftLayer
Clouds can be deployed as public—all services run in a secure environment hosted in the cloud, where servers may be
shared with others—or private, which is available only to the user’s organization and may exist on or off premises. In
addition, clouds can be deployed as hybrids, where parts are on premises and other services are in the cloud.
Description Transmit data ove Transmit data ove Communication b Lightweight protoc Queue system to
r Internet from ap r Internet from ap us to connect intel ol for collecting da reliably transfer m
plications, website plications, website ligent machines ta and publishing i essages between
s, and so on s, and so on t to servers and s applications and p
ubscribers rocesses (server
s)
Real-Time Behav No No Yes, us–ms range No, ms–s range No, seconds rang
ior e
Security Yes: HTTPS (SSL Yes: wss:// (SSL/T Yes Possible: SSL or Yes: TLS or SASL
or TLS) LS) TLS (Simple authentic
ation and Security
layer)
LabVIEW Suppor Yes, native Yes, via VI Packa Yes, via VI Packa Yes, Implementati Implementations
t ge Manager (Medi ge Manager (RTI) ons on VI Packag on VI Package M
aMongrels) e Manager, LabVI anager (LabbitM
EW Tools Networ Q) and GitHub
k, and GitHub
The next section describes the most common protocols, MQTT, AMQP and DDS, in further detail.
2. MQTT
Message Queueing Telemetry Transport (MQTT) is an IoT connectivity protocol. MQTT is used in applications with
thousands of sensors, including power usage monitoring and oil pipeline monitoring. MQTT is efficient in terms of
bandwidth, battery, and resources. MQTT uses a publish/subscribe model. The IoT devices publish data to an MQTT
broker over TCP as a topic. An authorized client can subscribe to any topic and receive the value from the broker as
they arrive from the publisher. The publisher (device) does not need to know about any of the subscribers, which makes
the management easier at the device level. The broker can support multiple concurrent connections from many devices.
A topic is a simple string that can have hierarchical levels and supports also wildcards. An example of a topic is
GothamCityPlant/Building1/Pump7/Power. The message data is transmitted in JSON format and may be specific to the
cloud platforms’ IoT service.
http://www.ni.com/white-paper/53954/en/ 3/7
7/22/2017 A Practical Guide for Connecting LabVIEW to the Industrial IoT - National Instruments
Figure 3 – Edge Devices Sent MQTT Messages over the Internet to a Central Broker Which Distributes the Messages to
Authorized Subscribers
MQTT supports three quality-of-service levels:
QoS 0—At most once
QoS 1—At least once
QoS 2—Exactly once
MQTT can be implemented using standard HTTP calls within LabVIEW. NI Alliance Partners as well as community
versions of such implementation exist on the LabVIEW Tools Network
(http://www.ni.com/np/app/main/p/bot/no/ap/lvtn/lang/en/pg/1/sn/n25:software,n21:28/sb/default/?q=mqtt) and GitHub.
One open-source version that implements TLS/SSL is available here (https://github.com/Indie-Energy/AWS-IoT-
RESTful) on GitHub.
To debug MQTT communications, a MQTT client can be installed on a local computer. A popular free MQTT client is
MQTTfx, available at mqttfx.org/ (http://www.mqttfx.org/).
Several MQTT brokers to test communication are on the Internet. One of the most popular is mosquitto. To test the
communication, you can publish topics to test.mosquitto.org. The mosquitto broker is open source and can also be used
in-house for sandbox testing or production use of MQTT communication.
3. AMQP
Advanced Message Queuing Protocol (AMQP) is an open message protocol that can send transactional messages
between servers and from devices to servers and vice versa. Advantages of AMQP are the reliable communication (data
is received reliably exactly once at the receiving end) and interoperability. AMQP uses a broker to receive data from a
client. The client (or publisher) then publishes the message to the broker, where it is processed and routed to a queue.
From the queue, the message is sent to any client who has subscribed to this data. AMQP focuses on tracking all
messages and ensuring each is delivered as intended, even if a device is temporarily offline. Devices that generate
loads of data can stream to AMQP servers, which is then consumed by receivers to perform monitoring and analytics.
An example application for AMQP is the analysis of automotive driving behavior at the data center. Some cloud
development platforms support device connectivity to AMQP or AMQP over WebSocket. Popular open-source AMQP
brokers you may come across are RabbitMQ, ActiveMQ, and Kafka.
LabbitMQ is an AMQP library for LabVIEW that can be installed from the VI Package manager. An open-source AMQP
client implementation in LabVIEW is available on GitHub (https://github.com/tweeto/AMQP-Client).
4. DDS
The Data Distribution Service (DDS) main use case is to distribute data directly to other devices, although it can also
distribute data to enterprise systems and mobile devices. Applications are found in wind farms, automotive test, asset
tracking, and defense and big physics. Devices often need each other’s data in real time measured in milliseconds. All of
this needs to happen reliably and usually with large data streams. DDS offers a detailed quality of service control, with
configurable reliability, redundancy, and filtering, and selects exactly which data goes where. To do so, DDS uses a
device-to-device bus communication, which can deliver the data to thousands of devices.
LabVIEW support for DDS can be installed through the VI Package Manager. RTI provides an excellent tutorial
(https://community.rti.com/static/documentation/connext-
dds/5.2.3/doc/manuals/labview/RTI_DDS_Toolkit_for_LabVIEW_GettingStarted.pdf) on the use of DDS with LabVIEW.
http://www.ni.com/white-paper/53954/en/ 4/7
7/22/2017 A Practical Guide for Connecting LabVIEW to the Industrial IoT - National Instruments
7. PTC ThingWorx
ThingWorx is a model-based IoT application development platform that provides a complete application design, run time,
and environment. ThingWorx provides components for connectivity, analytics, collaboration, and visualization including
augmented reality. The core development features of the platform are:
Composer—An application modeling environment to model the “things,” logic, visualization, data storage, and
security
Mashup builder—A web page is called a mashup with ThingWorx, and visualization of web pages can be created
using the mashup builder tool
SQUEAL—A search feature that allows searching through all data in a model
Execution engine and storage—Event-driven platform for execution and storage to store, relate, and expose big data
to make it valuable and actionable
ThingWorx supports device connectivity in several ways: direct network connections, MQTT and AMQP, third-party
device clouds, and OPC-UA connectivity through PTC Kepware software.
NI released an IoT Education beta (http://forums.ni.com/t5/NI-Labs-Toolkits/NI-IoT-Education-Beta/ta-p/3610067)
program featuring connectivity from the myRIO Student Embedded Device to the ThingWorx platform during NIWeek
2017.
8. Microsoft Azure IoT Suite
The Azure IoT Suite allows data collection from devices and provides a set of services like data analysis, data storage,
real-time and historical data visualization, and integration with back-office systems. The Azure IoT hub receives the data
from IoT devices. The device data can then be stored or passed on for further processing, analytics, and management.
Devices can communicate with the IoT hub over HTTP, MQTT, or AMQP protocols. Microsoft offers a set of Azure IoT
device SDKs through GitHub.
Other cloud platforms are available, such as Google Cloud Platform, GE Predix, and many more. For more information,
see the vendor’s specific product pages.
AWS IoT IBM Watson IoT for Blu PTC ThingWorx Microsoft Azure IoT
emix
Free Evalu 1-year free trial 30-day trial, then free Lit 30-day trial IoT Hub free trial for unli
ation e version mited time
Pricing Usage basis, no minimu Pay per device, data exc Subscription, then pay d Usage based (No. of IoT
m fees hanged, data stored epending on usage Hub messages)
Deployme Public cloud Public or private Private or hybrid Public, private, or hybrid
nt Options
AMQP Use SQS instead or 3rd Through 3rd party Yes Yes
party
Storage S3 (files), DynamoDB (N Cloudant (NoSQL datab Data tables, streams, an SQL storage, Document
oSQL database), Redshi ase), Mongodb, and oth d value streams DB (NoSQL), blob stora
ft (database), and others ers ge (files), and table stora
ge
LabVIEW Yes, LabVIEW Cloud To Yes, MQTT Yes, MQTT/AMQP Yes, MQTT/AMQP
Connectivi olkit for AWS; MQTT
ty
Rules Engi Yes, rules engine acts o Yes, that is, node.js appli Yes, Expression Widget Yes, Azure Stream Analy
ne n the data and routes on cation tics
to other services
Visualizati QuickSight or custom de Yes, Watson IoT Real-Ti Yes, ThingWorx SQUEA Via Azure web apps, po
on of Data velopment me Insight L, widgets, Vuforia, and wer BI, and notifications
Mashup
Platform M Amazon Machine Learni IBM Predictive Analytics Predictive Analytics Azure ML
achine Lea ng
rning
Appendix B: Sources
AWS https://aws.amazon.com
IBM http://www.ibm.com
Intel http://www.intel.com
PTC http://www.ptc.com/internet-of-things/technology-platform-thingworx
NI http://www.ni.com/nl-nl/innovations/industrial-internet-of-things.html
Electronic Design—Understanding the protocols behind the internet of things
http://www.electronicdesign.com/iot/understanding-protocols-behind-internet-things
Internet of Things (IoT) Development Platforms—A case of IBM Bluemix, P Kumar, Univ. of Koblenz-Landau
https://kola.opus.hbz-nrw.de/frontdoor/index/index/docId/1373 (https://kola.opus.hbz-nrw.de/frontdoor/index/index/docId/1373)
IoT Standards and Protocols https://www.postscapes.com/internet-of-things-protocols/
Industrial Internet of Things Platform Comparison https://www.mandsconsulting.com/industrial-iot-platform-comparison
Books:
Internet of Things, W. Vermeend, J.W. Timmer, 2016, ISBN 97890821993-4-5
Enterprise IoT, Naveen Balani, 2016, ISBN 9781535505642
http://www.ni.com/white-paper/53954/en/ 6/7
7/22/2017 A Practical Guide for Connecting LabVIEW to the Industrial IoT - National Instruments
The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of
the mark on a worldwide basis. A National Instruments Alliance Partner is a business entity independent from National
Instruments and has no agency, partnership, or joint-venture relationship with National Instruments.
http://www.ni.com/white-paper/53954/en/ 7/7