Getting Started with the NXT Module in LVEE


Chris Rogers
Wednesday, November 25, 2009

1. Writing a first program:

A. Open LabVIEW
B. Select “Blank Vi…” (vi stands for Virtual Instrument and is the name for a LabVIEW program)

C. Right-click on the diagram to bring up the palette
D. Select "NXT Robotics"
E. And pin it - using the pin in the upper left corner. Your screen should look like:

F. Select "NXT I/O"
G. Click and drag the Motor Control vi on to the diagram:
H. Add the Wait For vi and another Motor Control vi
I. Wire the icons together by moving the mouse to the upper right corner of the first vi (note that the cursor changes), click, the move to the upper left corner of the next vi and click. Make sure that the words NXT are visible and that you are wiring the pink NXT wire:
J. Then click on your second motor icon and change Fwd to Brake. Your final code should look like:
K. Now connect up your NXT, turn it on and then hit the run button on the top left of the window and watch your motors go for 1 second.

2. Watching your program execute

A. Select “Execution Highlighting” by clicking on the light bulb (blue circle in image above).
B. Hit run - and watch each vi being executed.

3. Targeting the NXT (autonomous control)

A. Right now you are targeted to the computer (the computer does all the thinking). You want to compile and download into the NXT - to do this change the execution target - go to the File Menu and select “Target NXT”

B. Hit run - it will compile and download into the NXT and run it.
C. Disconnect your NXT
D. Hit the orange button a few times to select “run” and it will run again.

4. Where to go from here

A. Help
I. Every vi has “roll over” help - Select “Show Context Help” in the Help menu

II. Every NXT vi has extended help - right click on the vi and select help - as below:

III. There are also over 100 pages of help text and examples in the NXT Module Help in the Help Menu and at http://www.legoengineering.com
B. More Hints

I. Go to the Tools Menu -> NXTApplications - try out the Data Viewer or the Piano Player. More help can be found in the NXT Module Help
II. Go the Tools Menu -> NXT Tools and try out the NXT Terminal
III. Go to the Tools Menu -> NXT Preferences and look under Targeting NXT. Keeping only one program resident on your NXT can help you save memory and never get the “out of memory” error.

Home | About Us | Contact Us
© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.