Getting Started with the LabVIEW Toolkit for LEGO MINDSTORMS NXT

Similar documents
Using the Lego NXT with Labview.

Rescue Rover. Robotics Unit Lesson 1. Overview

Technology. Using Bluetooth

Technology. In the My Files [My Files] submenu you can store all the programs that you have made on the NXT or downloaded from your computer.

Technology. Using Bluetooth

1001ICT Introduction To Programming Lecture Notes

Robot Soccer Challenge

Robot Activity: Programming the NXT 2.0

Version 3.1.0: New Features/Improvements: Improved Bluetooth connection on Windows 10

Previous Release Notes

Introduction WELCOME TO LEGO MINDSTORMS EDUCATION

Mapping a Magnetic Field. Evaluation copy. Figure 1: Detecting the magnetic field around a bar magnet

Technology. In the My Files [My Files] submenu you can store all the programs that you have made on the NXT or downloaded from your computer.

XC2 Client/Server Installation & Configuration

Laboratory 2(a): Interfacing WiiMote. Authors: Jeff C. Jensen (National Instruments) Trung N. Tran (National Instruments)

The NXT Generation. A complete learning solution

LEGO Engineering Conferences ROBOLAB and MINDSTORMS Education Version 4.5 March 2008

Oxygen Meter User Manual

REMOTE CLIENT MANAGER HELP VERSION 1.0.2

How to Download a Red App

Mac Software Manual for FITstep Pro Version 2

Fencing Time Version 4.3

HyperSecureLink V6.0x User Guide

PRODUCT MANUAL. Diver-Mobile for Android

Standard League WRO Football Simple Simon EV3 Training Curriculum

Heating of Land and Water

Experiment AMe-1: Small Animal Respiratory Exchange Ratio (RER)

GEN II Robot Soccer EV3 Compass Training Curriculum Brian Thomas

Quick Start Guide. A. Hardware installation B. Software installation C. Start the software for the first time D. Do your first measurement

The ICC Duckworth-Lewis Calculator. Professional Edition 2008

Tournament Manager: Running a VEX IQ Event - Beginner

Diver-Office. Getting Started Guide. 2007, Schlumberger Water Services

Kestrel HVK Gun Loader Sofware

Race Screen: Figure 2: Race Screen. Figure 3: Race Screen with Top Bulb Lock

Simple Simon GEN II Robot Soccer EV3 -Tris 10 Training Curriculum

Experiment AMe-1: Small Animal Respiratory Exchange Ratio (RER)

Axis Camera with VaxALPR On Camera software: License key

Microsoft Windows Software Manual for FITstep Stream Version 4

Quintic Automatic Putting Report

ALGE DIVE! ALGE. ALGE-TIMING GmbH & Co

KEM Scientific, Inc. Instruments for Science from Scientists

Figure SM1: Front panel of the multipatcher software graphic user interface (GUI) at the beginning of multipatcher operation.

e d u c a t i o n NXT Solar Station

DIVE MEET SCORING INSTRUCTIONS. Day before meet

TR Electronic Pressure Regulator. User s Manual

BVIS Beach Volleyball Information System

Free Golf Scorer. Installation: Page: 1 / 9 28/06/10

FireHawk M7 Interface Module Software Instructions OPERATION AND INSTRUCTIONS

New Cortex Software User Guide

General Rules 2010: Regular category

DDR Dive Data Recorder Manual - Rel /12

Standard League Robot Soccer EV3 Compass Training Curriculum Brian Thomas

ITF SCORER ONLINE TRAINING SETUP

1. Software Installation Please make sure to install software before connecting the PC Interface Unit to your Computer.

FLL Rosters For Coaches For Parents Team Rosters

Database of Winds and Waves. -internet version-

Instruction Manual. BZ7002 Calibration Software BE

USER MANUAL April 2016

What to Expect at Your First FTC Tournament. Eric Grajales Mike Nicolai September 17, 2011

NATIONAL UNIVERSITY OF SINGAPORE. EE3302/EE3302E Industrial Control Systems E1: ADVANCED CONTROL SYSTEMS

Beginner Category Tug of War 2v2

Horse Farm Management s Report Writer. User Guide Version 1.1.xx

Fisher FIELDVUE DVC6200f Digital Valve Controller PST Calibration and Testing using ValveLink Software

EXPERIMENT 12 GAS LAWS ( BOYLE S AND GAY-LUSSAC S LAW)

Pressure Sensor 150 to 1150 mbar Product Number: ENPRS015

Upgrading Bio-Plex Manager 4.1, 5.0, or 6.0 Software to Bio-Plex Manager 6.1 Software

RM-80 respiration monitor

v2.3 USER MANUAL

World Robot Olympiad 2018

Integrate Riverbed SteelHead. EventTracker v8.x and above

Software Manual for FITstep Pro Version 2

General Rules 2015 Season

GHSA Swimming/Diving POP School User s Guide

MASK INTEGRITY TEST ACCESSORY (MITA) MODEL 8120

Timex Ironman Run Trainer Powered by GPS Technology

Pegas 4000 MF Gas Mixer InstructionManual Columbus Instruments

Setting up the Ingenico isc250 Pinpad via USB in Windows 8

Boyle s Law: Pressure-Volume Relationship in Gases

Blackwave Dive Table Creator User Guide

Revision: 23 March 2008 (nk)

Callaway upro Golf GPS. User Guide (v1.3) 2009 Callaway Golf Company

Using the Sailwave Results Programme April 2016

Welcome to Step Outside with Togo & Nogo a road safety training resource for year 2 children

The ICC Duckworth-Lewis-Stern calculator. DLS Edition 2016

Savannah S100 ALD at SCIF, UC Merced Standard operating Procedure

SSI Solaris 150 RTA Revision /27/2016 Page 1 of 9. SSI Solaris 150 RTA

PC Configuration software for Discovery MkVI v 1.03 User guide

AutoTrace SPE Workstation User s Manual

SHIMADZU LC-10/20 PUMP

Soft Systems. Log Flume - 1. Enter Specification. Activity One ACTIVITIES. Help. for Logicator

Operating Instructions EB EN. Series 373x Electropneumatic Positioner Type 373x-5 EXPERT + with FOUNDATION fieldbus communication

How to zero calibrate your CO2 sensor with a GSS evaluation kit

GA-300 Gas Analyzer. Technical Note. Overview. Front Panel. iworx Systems, Inc. GA-300

Tennis Ireland National Player Database

Using MATLAB with CANoe

This is the second part of the installation and set-up guide for this latest version of the NRS, covering:

BUYER S GUIDE AQUAlogger 530WTD

ANALOX MRC MkII USER INSTRUCTION MANUAL

Quadruple mass spectrometers (transducer type)

Fitbit Walking Challenge Participant Guide

Transcription:

Getting Started with the LabVIEW Toolkit for LEGO MINDSTORMS NXT

Contents Overview...2 Mass Compiling...2 Building a LabVIEW VI that Runs on the NXT...3 Running a LabVIEW VI on the NXT...4 Building a LabVIEW VI that Communicates with the NXT...5 Creating New Blocks for LEGO MINDSTORMS NXT Software...6 National Instruments Corporation i Getting Started with LabVIEW for LEGO MINDSTORMS NXT

Overview The LabVIEW Toolkit for LEGO MINDSTORMS NXT enables you to Write standard LabVIEW code that you can compile and download to the NXT Write LabVIEW programs that run on the PC or Mac and communicate with the NXT through USB and Bluetooth Create blocks that you can import into the LEGO MINDSTORMS NXT Software Note You must use LabVIEW 7.1 to create MINDSTORMS blocks, because the MINDSTORMS software is based on LabVIEW 7.1 This document contains exercises that you can use to learn how to develop NXT VIs with the LabVIEW Toolkit for LEGO MINDSTORMS NXT. These exercises require a basic understanding of the LabVIEW Development environment. Refer to the Getting Started with LabVIEW document, accessible from ni.com/documents, for an introduction to LabVIEW. Note The instructions in this document assume that you are using LabVIEW 7.1. Mass Compiling To run this toolkit efficiently, you must mass compile the toolkit VIs in the version of LabVIEW in which you installed the toolkit. Complete the following steps to mass compile the LabVIEW Toolkit for LEGO MINDSTORMS NXT. 1. Launch the version of LabVIEW in which you installed the toolkit. 2. Select Tools»Advanced»Mass Compile. 3. Browse to the labview\vi.lib\addons\nxttoolkit folder and select Curr Dir. 4. Select Mass Compile to begin the mass compile process. Note Mass compiling the toolkit takes around 10 minutes on most computers. Getting Started with LabVIEW for LEGO MINDSTORMS NXT 2 ni.com

Building a LabVIEW VI that Runs on the NXT In this exercise, you will build a program that reads the value of the sound sensor on the NXT and displays a sound level graph on the PC. 1. Select File»New VI to begin developing a new VI. Then, display the block diagram. Note Ensure that LabVIEW is targeted to the desktop before creating the new VI. 2. Select NXTToolkit from the All Functions palette to display the NXTToolkit palette. The NXTToolkit palette contains the LabVIEW objects supported by the MINDSTORMS NXT compiler as well as additional libraries that access the NXT inputs and outputs. Note To compile your VI to an NXT, you must use only the items found in the NXTToolkit palette and its subpalettes. 3. Select NXTToolkit»Structures»While Loop and place the While Loop on the block diagram. 4. Right-click the Loop Condition of the While Loop and select Create Constant from the shortcut menu. 5. Select NXTToolkit»NXT Library»Input»Sound Sensor and place the Sound Sensor VI in the While Loop. 6. Display the front panel. Then, select All Controls»XTToolkit»Graph»Waveform Chart and place the waveform chart on the front panel. 7. Display the block diagram. Then, move the waveform chart inside the While Loop and wire the Volume output from the Sound Sensor VI to the waveform chart. When you complete this exercise, the block diagram should appear similar to the figure below. 8. Save the VI, and follow the steps in the next section to compile, download, and execute the VI on the NXT. You will need to use the Debug button to view the waveform graph on the front panel. National Instruments Corporation 3 Getting Started with LabVIEW for LEGO MINDSTORMS NXT

Running a LabVIEW VI on the NXT In this exercise, you will learn how to compile, download, and run a VI on an NXT device using the NXT Terminal. The NXT Terminal allows you to target a LabVIEW program to an NXT device. You can use the NXT Terminal to compile, download, and run VIs on the NXT. You also can use the NXT Terminal to upload, download, or delete files on the NXT. If multiple NXTs are connected to the computer through USB or Bluetooth, you can add additional NXT Terminals as necessary. 1. Open the LabVIEW VI you want to run on the NXT. 2. Launch the NXT Terminal by selecting Tools»NXT Module»NXT Terminal. The VIs you currently have open automatically appear in the PC VI Files listbox. 3. To connect the NXT Terminal to an NXT device, use one of the following options: Plug in an NXT through USB and it will automatically connect. Click the Find NXT button and choose an NXT connected through USB or scan for available NXTs using Bluetooth. 4. After you connect the NXT Terminal to an NXT device, select the VI you want to run from the PC VI Files listbox, and use one of the following options. Note To run the VI you created in the previous exercise, you must use the Debug button. Click the Compile, Download and Run button to compile, download, and execute the VI on the NXT without maintaining a link to the host computer. Click the Compile and Download button to compile and download the VI to the NXT without running the VI. Click the Debug button to compile, download, and execute the VI on the NXT. This option maintains a link back to the host computer so you can use the front panel controls and indicators to communicate with the NXT. Note Using the Debug button with multiple NXT Terminals at once is not supported. Click the Abort button to stop running the VI. Note The compile process generates a.rxe file with the same name as your VI. If your VI name contains over 15 characters, LabVIEW truncates the name of the.rxe file to 15 characters. Refer to the LabVIEW\examples\NXT Toolkit\NXT Programs directory for more NXT programming examples. Getting Started with LabVIEW for LEGO MINDSTORMS NXT 4 ni.com

Building a LabVIEW VI that Communicates with the NXT In this exercise, you will build a VI that runs on the host computer and communicates with the sound sensor on the NXT. 1. Select File»New VI to begin developing the VI. Note Ensure that LabVIEW is targeted to the desktop before creating the new VI. 2. Select All Functions»NXT Direct Commands. This palette contains a library for communicating with an NXT, regardless of whether a program is currently running on the NXT. Note The NXT Direct Commands»BT Messages palette contains a library for communicating with an NXT through mailboxes accessible only to a running program. 3. Select NXT Direct Commands» Connection»Find NXT, and place the Find NXT VI on the block diagram. 4. Right-click the NXT name input on the Find NXT VI and select Create Constant from the shortcut menu. Enter the name of your NXT in the string constant. After you complete this step, the block diagram should appear similar to the figure below. Note Ensure that the capitalization of your NXT name is correct. 5. Select NXT Direct Commands»Connection»Create NXTObject, and place the Create NXTObject VI next to the Find NXT VI. Wire the VISA resource string output of the Find NXT VI to the VISA resource string input of the Create NXTObject VI. Wire the error out output of the Find NXT VI to the error in input of the Create NXTObject VI. After you complete this step, the block diagram should appear similar to the figure below. 6. Select NXT Direct Commands»Utilities»Get Battery Level, and place the Get Battery Level VI next to the Create NXTObject VI. Wire the NXTObject output of the Create NXTObject VI to the NXTObject input of the Get Battery Level VI. Wire the error out output of the Create NXTObject VI to the error in input of the Get Battery Level VI. 7. Right-click the millivolts output of the Get Battery Level VI, and select Create Indicator from the shortcut menu. After you complete this step, the block diagram should appear similar to the figure below. National Instruments Corporation 5 Getting Started with LabVIEW for LEGO MINDSTORMS NXT

8. Select Direct Commands»Connection»Destroy NXTObject, and place the Destroy NXTObject VI next to the Get Battery Level VI. Wire the NXTObject output of the Get Battery Level VI to the NXTObject input of the Destroy NXTObject VI. Wire the error out output of the Get Battery Level VI to the error in input of the Destroy NXTObject VI. After you complete this step, the block diagram should appear similar to the figure below. 9. Press the Run button to execute the program. Note Since this VI executes on the host computer and not on the NXT, use the Run button on the front panel or block diagram instead of the Run button on the NXT Terminal. 10. You now can view the NXT battery level on the front panel. Refer to the LabVIEW/examples/NXT Toolkit/Direct Commands directory for more NXT direct command programming examples. Creating New Blocks for LEGO MINDSTORMS NXT Software Blocks are the objects you use to program NXT devices in the MINDSTORMS software. You can use the LabVIEW Toolkit for LEGO MINDSTORMS NXT with LabVIEW 7.1 to create blocks that you can import into the LEGO MINDSTORMS NXT Software. Refer to labview/documents/ NXT_Creating_MINDSTORMS_Blocks.pdf for an introduction to the block creation process. National Instruments, NI, ni.com, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section on ni.com/legal for more information about National Instruments trademarks. LEGO and MINDSTORMS are trademarks of the LEGO Group. Other product and company names mentioned herein are trademarks or trade names of their respective companies. For patents covering National Instruments products, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your CD, or ni.com/patents 2006 National Instruments Corporation. All rights reserved.