LEGO Engineering

| | | | | | | |
Can I data log in the NXT software?


22nd of April, 2010

(50 )
96% thumbs up 4% thumbs down

Data logging is not possible in the LEGO Mindstorms NXT Software (NXT-G) in the same way data logging works for the ROBOLAB 2.9 software. However, you can use "files" to datalog in NXT-G.

In NXT-G, files are both readable and writable from the on-board programs, so you can write a program that writes data to a named file, and then reads that data at a later point in time. An external computer is not needed for this function. A file on the NXT can hold text strings as well as numbers.


The attached NXT-G program will allow you to store one set of data at a time on your NXT. This program is adapted from a program written by Brian Davis.  Here are screenshots from the program.






Further Instructions for Datalogging With LEGO™ Mindstorms NXT Educational Software (NXT-G)

  1. Download the file <Dlog_basic.rbt> onto your computer. It is attached to this question.
  2. Start NXT-G software, and go to File → Open → Dlog_basic.rbt
  3. Review the program and its comments to get a sense for how it works.
  4. The program is set to datalog from the ultrasonic (position) sensor. If you want to take data a different sensor, drag the appropriate sensor icon on top of the ultrasonic icon, and then delete the ultrasonic icon. The new icon should now be in its place. Check the settings for your new icon, which are found at the bottom of the screen, and make sure you take note of the selected port. The sensor icons are in the Complete palette (second tab at bottom left of screen), and they appear when you place the mouse over the yellow Sensor icon at the left of the screen.
  5. Connect the appropriate sensor to the appropriate port on the NXT.
  6. Connect the NXT to computer.
  7. Download the program to the NXT by clicking on the “Download and run” triangle button at the bottom right of the program screen.
  8. You may disconnect the NXT from the computer.
  9. To start logging data, press the orange button on the NXT.
  10. To stop logging data,  press the orange button again.
  11. Reconnect the NXT to the computer, and click on the NXT image button at the bottom right of program screen.
  12. Once the dialog box is open, click the Communications tab if it is not already at the front.
  13. Click on the Scan button to scan the NXT’s memory.
  14. Click on the Memory tab to view the files in the NXT’s memory.
  15. Check the Show System Files box, and click on the underlined Other category at the left of the dialog box.
  16. Find and highlight Datalog.txt in the file list.
  17. Click on the Upload button, and note where the file is being saved.
  18. Close the dialog box.
  19. Open Excel or another spreadsheet/plotting application, import the datalog text file (it is comma-delimited), and plot the data.

 
Further Instructions for Datalogging With Robolab 2.9

  1. In Robolab 2.9, the simplest way to datalog is to use the Investigator module, which is chosen from the initial splash screen when you load Robolab. Please refer to the instructions for the “Scavenger Hunt” activity for further information about datalogging with Robolab Investigator.
  2. You may also use Inventor Level 4 to write a datalogging program in Robolab. You will find many of icons you need in the “Investigator” functions menu. In the default view of the Inventor 4 Functions Palette, the Investigator menu icon is located to the right of the Music menu icon (the piano).
  3. Icons for 3rd party sensors (HiTechnic or Mindsensor: e.g., acceleration, color, compass) are found in the “User Libraries” functions menu. In the Inventor 4 Functions Palette, the User Libraries menu icon looks like a yellow file folder with a tiny RCX on it.




KAB

   :
   :
* :
* :
 


Home | About Us | Contact Us

© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.