labview program and data flow review labview robotics fundamentals

13
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Upload: herbert-ellis

Post on 11-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

LabVIEW Program and Data Flow Review

LabVIEW Robotics Fundamentals

Page 2: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Data Flow

• Many code objects in LabVIEW generate data– Constants always put out

one “constant” value– Read Sensor commands

send out sensor values– Operations like “Divide”

send out result values• Data flows through wires

Value = 75

Value = Sound Sensor Reading

Value = Ultrasonic Sensor Reading divided by 2

Page 3: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Data Flow

• Data is used by commands and Structures

Motor power set to 75

Motor power set to Sound Sensor value

Motor power set to Sound Sensor value divided by 2

Page 4: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Data Flow

• Data is used by commands and Structures

Repeats 8 times

If Touch Sensor is Pressed, run this “True” pane code

Repeats until Port C Rotations exceed 1800 degrees

Page 5: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Front Panel Data

• The Front Panel can provide and display data– Controls generate values that can be used in code

– Indicators display values in different ways

Page 6: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Data Flow

• Every command in LabVIEW runs as soon as all its “incoming” data is ready

• The NXT Pink Wire is actually just a creative use of Data Flow to create sequences of commands that have to wait for one another

Page 7: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Data Flow: Parallelism

• Every command in LabVIEW runs as soon as all its “incoming” data is ready– This even lets multiple code strands run at once!

Page 8: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Controlling Program Flow

• Structures can control when commands run– Sequence Structures force groups of commands

to run in a certain order

Page 9: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Controlling Program Flow

• Structures can control when commands run– Case Structures choose alternative sets of code to

run, based on an input value

Page 10: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Controlling Program Flow

• Structures can control when commands run– For Loops repeat code a set number of times

Page 11: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Controlling Program Flow

• Structures can control when commands run– While Loops repeat code until a wired Stop

condition is reached

Page 12: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Control Loops

• Control Loops are a strategic arrangement of a Case and a Loop– Repeats a decision quickly so it looks “continuous”

Page 13: LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals

Shift Registers

• Shift Registers pass values across loop cycles– This allows values to “accumulate” or “count up”