+ All Categories
Home > Documents > Lesson 3: Program Deployment Programming Guide (LabVIEW

Lesson 3: Program Deployment Programming Guide (LabVIEW

Date post: 12-Feb-2022
Category:
Upload: others
View: 14 times
Download: 0 times
Share this document with a friend
4
Lesson 3: Program Deployment Programming Guide (LabVIEW for LEGO ® MINDSTORMS ® ) Introduction: In this guide, sensors will be configured and programs will be downloaded and run on the NXT Brick. This guide is for use with the LabVIEW for LEGO ® MINDSTORMS ® programming language. Connecting the NXT to the Computer: 1. Open the LabVIEW for LEGO MINDSTORMS Robot Project file for Lesson 3. a. On the DVD, navigate to Lessons and select Lesson 3. b. Then, under Resources on the left side, click on Programming. c. Under Programming, select Sample Programs and click on Program Deployment (LabVIEW for LEGO MINDSTORMS). d. Save the .zip file to the computer. Then, navigate the .zip file’s location, right-click the folder and extract it. e. Finally, open the extracted folder and double-click on the Lesson 3.lvrbt file to open the file. 2. Before opening a program, make sure that the computer is connected to an NXT Brick. a. Click the NXT Target: Unspecified box under the Choose NXT section. b. Select the NXT from the list. c. If no NXT is listed, or if the one that is connected is different than the one that is listed, click Find NXT and then click the Scan button to search for NXT Bricks. d. Select the NXT that shows up in the NXT List and click Connect. 65 TETRIX ® Getting Started Guide Lessons
Transcript
Page 1: Lesson 3: Program Deployment Programming Guide (LabVIEW

Lesson 3: Program Deployment Programming Guide (LabVIEW™ for LEGO® MINDSTORMS®)

Introduction:

In this guide, sensors will be configured and programs will be downloaded and run on the NXT Brick. This guide is for use with the LabVIEW™ for LEGO® MINDSTORMS® programming language.

Connecting the NXT to the Computer:

1. Open the LabVIEW for LEGO MINDSTORMS Robot Project file for Lesson 3.

a. On the DVD, navigate to Lessons and select Lesson 3.

b. Then, under Resources on the left side, click on Programming.

c. Under Programming, select Sample Programs and click on Program Deployment (LabVIEW for LEGO MINDSTORMS).

d. Save the .zip file to the computer. Then, navigate the .zip file’s location, right-click the folder and extract it.

e. Finally, open the extracted folder and double-click on the Lesson 3.lvrbt file to open the file.

2. Before opening a program, make sure that the computer is connected to an NXT Brick.

a. Click the NXT Target: Unspecified box under the Choose NXT section.

b. Select the NXT from the list.

c. If no NXT is listed, or if the one that is connected is different than the one that is listed, click Find NXT and then click

the Scan button to search for NXT Bricks.

d. Select the NXT that shows up in the NXT List and click Connect.

65

TETRIX® Getting Started GuideLessons

Page 2: Lesson 3: Program Deployment Programming Guide (LabVIEW

Lesson 3: Program Deployment Programming Guide (LabVIEW™ for LEGO® MINDSTORMS®)

Configuring the Sensors:

3. Now that the NXT Brick is connected, confirm the configuration of the Ultrasonic and Light sensors that were added to the

robot in this lesson. Open the Schematic Editor by clicking Open Schematic Editor.

4. The Ultrasonic Sensor is connected to Sensor Port 2, so click Sensor Port 2 and select LEGO® Ultrasonic.

5. Check for a proper reading from the sensor by looking at the graph underneath the Sensor Name, while moving an object in

front of it. The sensor distance should read between 0 and 255 cm, depending on the object position.

6. The Light Sensor is connected to Sensor Port 3. Click Sensor Port 3 and select LEGO Light.

7. In the Sensor Parameters, turn on the Light Sensor’s built-in light by clicking the Light On button. This will read the reflected

light value of the surface. The light sensor reading should be between 0 (for a completely dark surface) and 100 (for a

completely bright surface). Actual readings will vary based on the surface type, room lighting and factory sensor calibration.

66

LessonsTETRIX® Getting Started Guide

Page 3: Lesson 3: Program Deployment Programming Guide (LabVIEW

8. Make sure a proper reading is obtained from this sensor by looking at the graph underneath the Sensor Parameters, while moving a hand under the sensor.

9. Now that the sensors have been configured, click Close in the Schematic Editor.

10.From the Robot Project Center, double-click line follower.vi.

Lesson 3: Program Deployment Programming Guide (LabVIEW™ for LEGO® MINDSTORMS®)

67

TETRIX® Getting Started GuideLessons

Page 4: Lesson 3: Program Deployment Programming Guide (LabVIEW

Lesson 3: Program Deployment Programming Guide (LabVIEW™ for LEGO® MINDSTORMS®)

Downloading and Running a Program:

11. Look at the LabVIEW™ toolbar. Notice that there are three buttons required to run a program, each of which runs the program

in a slightly different way. These three buttons are: Run, Deploy, and Debug.

a. The Run button compiles the program onto the NXT Brick and immediately runs it.

Note: Make sure that the robot is on the floor, with nothing touching it. If it is connected using USB, ensure that the USB cable is long enough for the robot to move around freely.

b. The Deploy button compiles and downloads the program onto the NXT brick but does not run it until it has been chosen using the buttons on the NXT Brick.

i. This is very helpful if the program will be compiled using a USB connection but will not run immediately.

ii. The Line Follower program involves the robot moving, so the Run button will compile and run the program, causing the robot to start moving with the USB cable still attached. The Deploy button however, will only compile the program. Then, the USB cable can be removed and the program can be run.

c. The third method for running a program is the Debug option.

i. Essentially, Debug keeps the link between the LabVIEW for LEGO® MINDSTORMS® program on the computer and the NXT Brick.

ii. Use this to debug and analyze the program to make sure it is working properly.

12. Select the Run button or the Deploy button to run the line follower program.

13. Repeat steps 10-12 for the object follower.vi program.

68

LessonsTETRIX® Getting Started Guide


Recommended