National Instruments provides “LabVIEW For Lego Mindstorms,” an Add-On specifically designed for programming the Lego NXT brick. It works great if you are a LabVIEW user. But what if you want to integrate it with other applications, written in popular programming languages such as Java, C or C++? RTI DDS Toolkit for LabVIEW provides an additional set of blocks that you can use to easily share data between the NXT brick and applications written in other programming languages.
RTI DDS Toolkit for LabVIEW extends the benefits of RTI Connext DDS solutions to the LabVIEW platform. Connext DDS software offers a decentralized architecture for publishing and subscribing data. There are no brokers or servers: each application is either statically or dynamically linked with the RTI libraries. Data is exchanged peer-to-peer for extremely low latency and high scalability.
With the RTI DDS Toolkit for LabVIEW, LabVIEW applications can publish and subscribe to data in the same way as applications that use the Connext API directly. And because it uses the standard DDS interoperability protocol on the network, LabVIEW applications can transparently interoperate with any other DDS compliant application.
Connext DDS + LabVIEW at WorkLet's illustrate this concept with a demo application. First, we assemble a Lego Mindstorm robot with 3 I/O devices: the ultrasonic distance sensor, the touch sensor and the motor.
Then, we build two applications:
-
A Java application that sends commands to control the motor and receive live data from the robot’s sensors. This application publishes commands and subscribes to data using DDS. It has no knowledge of the existence of the Lego hardware. Download Java application source code
-
A LabVIEW application that uses both the Lego Mindstorms NXT Add-On, and the RTI DDS Toolkit for LabVIEW Add-On. This LabVIEW application serves as a bridge for data to flow between the robot and applications that interface with it. Download VI file for LabVIEW application
Here's what the architecture looks like:
Do It Yourself
To set up the demo, you'll need:
-
A Lego Mindstorms NXT robot
-
LabVIEW 2012 or later
-
RTI Connext DDS Professional (trial version)
-
Eclipse SWT for your platforms
To compile and run the Java application in Eclipse:
-
Import the project into Eclipse
-
Import -> General -> Existing Projects into Workspace.
-
Select the archive file above
-
-
Include the following RTI Connext .jar files to the project:
-
[NDDSHOME]/ndds.[version]/class/nddsjava.jar
-
[NDDSHOME]/ndds.[version]/class/rticonnextmsg.jar
-
-
Include the Eclipse SWT swt.jar of your appropriate platform into the class path.
-
Include the path to the RTI Connext DDS native libraries:
In the Run Configurations for this demo, go to the Environment tab and add the path variable for your platform. To determine which variable to add, look at the RTI Connext Platform Notes. After installing RTI Connext DDS Professional, you can find the Platform Notes document in [NDDSHOME]/ndds.[version]/doc/pdf/RTI_DDS_PlatformNotes.pdf. The following example is from a Mac:
-
Compile the application and make sure there are no errors.
To run the demo:
-
Power on the Lego NXT brick, and wait for about a minute to make sure the Bluetooth connection is ready.
-
Run the LabVIEW application. It will try to detect the Lego NXT brick.
-
Run the Java application. You should now be able to see live status from the distance and touch sensor, and you should also be able to drive the robot around using the buttons. See the video above for the live demo.
Questions? Email labview@rti.com or chat with our experts in the RTI Community.
Learn More:
Autonomous Vehicle Production »
Posts by Tag
- Developers/Engineer (303)
- Connext DDS Suite (186)
- IIoT (125)
- News & Events (122)
- Standards & Consortia (122)
- Technology (74)
- Leadership (73)
- 2020 (54)
- Automotive (49)
- Aerospace & Defense (47)
- 2023 (35)
- Cybersecurity (33)
- Culture & Careers (31)
- Healthcare (31)
- 2022 (29)
- Connext DDS Tools (21)
- 2021 (19)
- Connext DDS Pro (19)
- Energy Systems (16)
- Military Avionics (15)
- FACE (13)
- Connext DDS Micro (12)
- JADC2 (10)
- ROS 2 (10)
- 2024 (9)
- Transportation (9)
- Connext DDS Cert (7)
- Databus (7)
- Connectivity Technology (6)
- Oil & Gas (5)
- Connext Conference (4)
- Connext DDS (4)
- RTI Labs (4)
- Case + Code (3)
- FACE Technical Standard (3)
- Research (3)
- Robotics (3)
- #A&D (2)
- Edge Computing (2)
- MDO (2)
- MS&T (2)
- Other Markets (2)
- TSN (2)
- ABMS (1)
- C4ISR (1)
- ISO 26262 (1)
- L3Harris (1)
- LabView (1)
- MathWorks (1)
- National Instruments (1)
- Simulation (1)
- Tech Talks (1)
- UAM (1)
- Videos (1)
- eVTOL (1)