programming in labview - indiana first · pdf fileprogramming in labview alan anderson ......

23
Programming in LabVIEW Alan Anderson Software Mentor TechnoKats Robotics Team (FRC #45) [email protected]

Upload: nguyenkien

Post on 06-Mar-2018

226 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

Programming in LabVIEW

Alan AndersonSoftware Mentor

TechnoKats Robotics Team(FRC #45)

[email protected]

Page 2: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

Programming in LabVIEW

What is LabVIEW?

How does it work?

How is it used for FRC?

Page 3: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

What is LabVIEW?

Laboratory Virtual Instrument Engineering Workbench

Designed for instrument/machine control

Virtual emulates Physical

Dataflow programming

Graphical Language

Page 4: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

What is LabVIEW?

Dataflow programming

Execution occurs when data is ready

Not “procedural” like Java or C++

Inherently parallel

Page 5: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

What is LabVIEW?

Graphical language

Icons and connectors

No underlying text representation

Not a GUI on top of another languageRobotC

EasyC

Page 6: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Virtual Instruments (VIs)

Terminals

Nodes

Wires

Structures

Variables

SubVIs

Page 7: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Virtual Instruments (VIs)

Front panel (user interface)

Block diagram (code)

Icon and connector (API)

Page 8: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Terminals

controls

indicators

(local variables)

Page 9: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Nodes

statements

functions

procedures

(SubVIs)

Page 10: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Wires

one source, arbitrary destinations

data typesnumeric

boolean

string

arrays

clusters

Page 11: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Structures

For Loop

While Loop

Case block

Sequence

Page 12: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Variables

local variables

global variables

(registry)

Page 13: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

SubVIs

Front panel becomes inputs and outputs

Block diagram determines behavior

Icon and connector pane defines external use

Page 14: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How does LabVIEW work?

Programming

menus

palettes

wiring

help

Page 15: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How is LabVIEW used for FRC?

Installation

WPIlib

LabVIEW RealTime

FRC cRIO Robot Project template

FRC Dashboard Project template

Example Projects

Page 16: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How is LabVIEW used for FRC?

Installation

DVD #1 of 2

~2 hours

Use Internet for activation

Page 17: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How is LabVIEW used for FRC?

WPIlib

Servos & PWMs

Relays & Solenoids

Digital I/O

Analog input

I2C communication

Abstracted stuff

Page 18: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How is LabVIEW used for FRC?

Abstracted stuff

Motor speed control

Multimotor drive control

Air compressor

Counters

Quadrature encoders

Accelerometers

Yaw Rate “gyro” sensors

Page 19: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How is LabVIEW used for FRC?

LabVIEW RealTime

Interactive execute: “run”

Compile to exe: “build”

Target cRIO: “deploy”

Page 20: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

How is LabVIEW used for FRC?

Predefined Templates

FRC cRIO Robot ProjectRobot Framework

Experiment Framework

FRC Dashboard Project (targets PC)

Example ProjectsReading sensors

Controlling actuators

Page 21: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

Programming in LabVIEW

?

Page 22: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

Programming in LabVIEW

!

Page 23: Programming in LabVIEW - Indiana FIRST · PDF fileProgramming in LabVIEW Alan Anderson ... Execution occurs when data is ready ... FRC Dashboard Project template

Programming in LabVIEW

Alan AndersonSoftware Mentor

TechnoKats Robotics Team(FRC #45)

[email protected]