LabView for Lego Mindstorms (LVLM) - FIRST in … · LabView for Lego Mindstorms (LVLM) FTC...

30
LabView for Lego Mindstorms (LVLM) FTC 2014-2015 Kick-Off 9/6/2014 Mike Turner FTC #4318 [email protected] Randy Gross FTC #4218 [email protected]

Transcript of LabView for Lego Mindstorms (LVLM) - FIRST in … · LabView for Lego Mindstorms (LVLM) FTC...

LabView for Lego Mindstorms(LVLM)

FTC 2014-2015 Kick-Off9/6/2014

Mike Turner FTC #[email protected] Gross FTC #4218

[email protected]

Outline

• The LabVIEW Environment

• General Programming

• LabVIEW “Targets”

• Getting Started

• Extra

LabVIEW Environment - Common

Context Help Window

NXT Toolkit Palette

BlockDiagram

Constants(Inputs)

Front Panel

LVLM – NXT Unique

NXT Terminal Window

Project Center

LVLM – NXT UniqueRemote Control Editor

Schematic Editor

General Programming

• Data Types

– Numeric

– Boolean

– String

– Ring

• Dataflow

• Loops

• Case Structure

Data Types: Numeric

• Whole Numbers (0,2,-10, …)

• Decimal Numbers (2.2, 12.3, -15.1, …)

Data Types: Boolean

• For Example:

– On/Off

– Yes/No

– True/False

Data Types: String

• Grouping of Characters

Data Types: Ring/Enumeration

• List of Predefined Items User Can Select

Dataflow

• Sequence Flow In/Out

Loops

• Repeat Code

– While Loop For Loop

Case Structure

• Best for “State Machine” Implementation

LabVIEW Targets

NXT Target

• VIs are compiled, downloaded, and executed by the NXT brick

• Only Front Panel debugging is possible

NXT Target

RXE

PC Target• LabVIEW code executes on development machine• Allows for full use of LabVIEW debugging tools• NXT “Direct Commands” can invoke methods in the NXT firmware• Higher level functions are called transparently using NXT Shell

PC Target

VI

Screen Display Sample

Getting Started

“If You Forget Everything Else”

• When in doubt, Right-click.

• Constants = Inputs (on Block Diagram)

• Controls = Inputs (on Front Panel)

• Indicators = Outputs (on Front Panel)

• Palettes (Right-click on Block Diagram, Front Panel)

• Context Help (“?”, CTRL + H, Help >> Show Context Help)

• NXT Terminal (Tools >> NXT Tools >> NXT Terminal)

• CTRL + E (Switch Views)

• CTRL + B (Cleanup Broken Wires)

• CTRL + U (Auto Redraw the Block Diagram)

A fast Tank-Drive from Remote Control Editor

• Remote Control Editor is a powerful tool to get started with!

Help• Right-click• Context Help (“?”, CTRL + H, Help >> Show Context Help)

• LabVIEW Help (Help >> Search the LabVIEW Help… >> Search: “NXT”)

• PDF Manuals (C:\Program Files\National Instruments\LabVIEW 2009\manuals)

– NXT_Getting_Started– NXT_Advanced_Programming_Guide– FTC_Getting_Started

• LabVIEW for LEGO MINSTORMS NXT (by Michael Gasperi)

• www.ni.com/academic/mindstorms/• https://sites.google.com/site/tuftsceeok12projects/labview-for-lego-support• http://www.tetrixrobotics.com/GettingStartedGuide/intro.htm• http://digital.ni.com/express.nsf/bycode/ftcsoftware• http://www.ni.com/academic/students/learn-labview/

– It has many videos, along with a more “in-depth” read hidden in the “Detailed Explanation” pull-down bar in the center of the page.

– 18 hours of content• http://www.ni.com/pdf/gettingstarted/introduction_to_labview_tutorial.pdf

– A “hands-on” tutorial– 3 hours

Debugging: What is going on?

• Use Probes

– Right click>>tool palette>>probe

– Right click on wire >> insert probe

• Use “Highlight Execution”

Extra

Another data type: Cluster

• Use this to pass many different data types.

Another data type: Array

• Use arrays when you have a lot of data of the same type.

What will you see when you first get started?

• Simple Teleop

File > New… > Virtual Instruments(.vi)

• Templates can help you get started on some advanced ideas very quickly.• Study and learn from them!• Use them if you can…

Templates!