Drexel University's Logo

Clayton McNeil

LabVIEW NXT Toolkit Overview


Home
About Me
Tutorials
Media Archive
Resources

The following is a personal evaluation of National Instrument’s Lego Mindstorms NXT Toolkit based on my own experiences and information gathered from several online resources, most notably NI’s Official NXT Toolkit Forum and the fan site NXTasy.org. While not comprehensive, this review highlights things to keep in mind when using or deciding to use the toolkit.


What is the NXT Toolkit?

The NXT Toolkit is an add-on for versions 7.1.1 and up of National Instrument’s LabVIEW, the graphical programming environment that was the basis for the Mindstorms NXT software that ships with the NXT device.

The toolkit consists of three components. The first is the NXT Terminal which allows LabVIEW to connect to the NXT device so that VIs (programs) can be compiled and downloaded to it. The New NXT Block Wizard is the second part of the toolkit and used to develop custom blocks which can be imported and used in the NXT Mindstorms software. The last aspect is the actual subVis (and functions) which can be used to construct NXT programs in LabVIEW. These are broken up into two categories: the NXT Library and the Direct Commands. The NXT Library is meant primarily for creating programs which will be compiled and run on an NXT device. As such, it contains premade subVIs which make most interactions with the NXT firmware (i.e. getting sensor data, rotating the motors, etc.) much easier. It also contains all the LabVIEW functions supported by the NXT device. On the other end of the NXT programming spectrum are the Direct Commands, a collection of subVIs built off the Fantom driver which was released as part of Lego Mindstorms’s Software Development Kit. This driver allows an application running on a PC to control of NXT device via either Bluetooth or USB, enabling the development of applications with greater functionality, such as GUIs.


What are the benefits of using the NXT Toolkit?

When developing programs that will run on the NXT Device itself, using LabVIEW has a number of advantages. Due to the fact that the NXT Mindstorms software is based off of it, LabVIEW programs have the potential of running faster because they are written on a lower level of abstraction. This coupled with the inherent power of LabVIEW also provides much greater access to the NXT Device firmware, allowing for the use of custom or third-party sensors and peripherals. Lastly, using LabVIEW is currently the only way to create custom blocks that can be imported into the NXT Mindstorms software.

As for the engineering applications that run on a PC, the Fantom driver has made this functionality possible on a number of platforms, such as Java, Perl and C. However, the graphical nature of LabVIEW and ease at which it allows the creation of robust GUIs make it a very strong option, even before considering that it was developed by the same company (National Instruments) that developed the firmware present on the NXT Device.


What are the drawbacks of using the NXT Toolkit?

At the time of this writing, the NXT Toolkit is only supported, and officially implemented, for the Windows operating system. While some users have reported issues with using the Toolkit in Windows Vista, these seem to stem from the restrictions placed on user privileges by the OS. The current workaround for this problem is to run LabVIEW with administrative rights. Because LabVIEW must compile applications into instructions that the NXT Device can compute, it should be noted that there are several limitations placed upon what LabVIEW features/functions can be used when developing programs that will run on the device. For a complete list of these limitations as well as a list of what is supported, refer to the LabVIEW for NXT Advance Programming Guide; however, the following details a few of these restrictions:

  • No floating-point numbers
  • No arrays of two or more dimensions
  • Only supports While loops
  • Case Structures must have cases with single values, i.e. no ranges such as 3..5
  • Sequence structures are limited to a single frame
The Direct Commands portion of the toolkit also has some issues, such as lacking a way a built-in way to control how many degrees a motor rotates. This, however, has less to do with LabVIEW and more to do with the way the Fantom driver works. Thus, it would be inherent in any development platform.




When should one use LabVIEW for NXT development?

LabVIEW is great when low level access to the NXT Device’s firmware is needed, such as interpreting RAW data when using custom, or hacked, sensors. When writing programs that will run on the NXT Device, LabVIEW and the NXT Mindstorms software each has its advantages. As mentioned earlier, LabVIEW works on a lower level of abstraction, so there are things that can be done there that cannot be accomplished with Mindstorms software out of the box. That said, the Mindstorms software is more convenient than LabVIEW in many ways. I found controlling program flow easier because of the software’s dependence on sequence beams. The option based menus simplify configuring properties such as how much power a motor should receive is done, as opposed to having to wire several constants or variables to a function. Things like sensor based loops which also help to reduce the clutter. To get the best of both worlds, the compromise here would be to create blocks in LabVIEW that provide the functionality needed to accomplish programming goals in the Mindstorms software. As a side benefit, these blocks can also be shared with members of the NXT community at large, regardless of whether they have LabVIEW or not.

Perhaps the greatest strengths of LabVIEW are found when using it in conjunction with Direct Commands to develop applications. Since these are run from a computer, they are not nearly as limited as their counterparts in the NXT Library. This enables the developer to tap into a great deal more of LabVIEW’s power. Also, the subVIs included in the Direct Commands side of the toolkit make establishing a connection with the NXT Device a simple affair.

The ancestral nature of LabVIEW and the NXT Mindstorms software and make it an obvious choice for more robust NXT development. However, to get the full benefit of LabVIEW’s use requires one to be moderately skilled with it to begin. The real deciding factor in whether to use it as opposed to other platforms is the developer proficiency and comfort level.


Home | About Me | Tutorials | Media Archive | Resources