Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

27/03/2014

ni.com

NI myRIO
Design Real Systems, Fast

ni.com

1
27/03/2014

Agenda
• Overview of NI myRIO

• Introduction to LabVIEW

• Connecting NI myRIO

• Introduction to LabVIEW Real-Time

• Introduction to LabVIEW FPGA

• Resources and Next Steps

ni.com 3

Overview of NI myRIO

ni.com
ni.com/students/learn-rio

2
27/03/2014

From Core Concepts to System Design

Controls Mechatronics

Final
Year
Design

Embedded
Robotics
Systems

ni.com 5

NI myRIO

Enclosed

Feature Rich

Protective Casing

Ecosystem
Board-Only
Optimized for Cost
• No Wi-Fi
• No myDAQ connector

Integrate into a Larger Project

ni.com 6

3
27/03/2014

NI myRIO Product Overview: Front View

XILINX Zynq SoC

ni.com 7

What is Zynq?

I/O

PCI Bus
AXI
Processor FPGA I/O

Specialty I/O

Traditional Implementation

ni.com 8

4
27/03/2014

667 MHz Dual-Core ARM Cortex-A9 processor


28K Logic Cells (Artix-7)
Xilinx ZYNQ 80 DSP slices, 16 DMA channels
ni.com
92 Billion calculations per second

Why Zynq Matters in Education

•Smaller Size, Lower Power

•667 MHz Dual-Core ARM Cortex-


A9 Processor

•Artix-7 FPGA, 28k logic cells

•16 DMA Channels

•NI Linux Real-Time

ni.com 10

5
27/03/2014

Why Zynq Really Matters in Education

Leading Industry
Grade Technology

ni.com 11

NI myRIO Product Overview: Front View

User Defined LEDs

ni.com 12

6
27/03/2014

Back View

Built-in Accelerometer

Mounting Holes

Getting Started

ni.com 13

Top View

Connection to PC

USB Port Power

ni.com 14

7
27/03/2014

NI myRIO Expansion Port (MXP)

Identical Connectors

4 AI MXP A MXP B

6 DIO 2 AO 1 UART
1 SPI

1 Quad Encoder
1 I2C
3 PWMs
ni.com 15

NI miniSystems Port (MSP)


Side

ni.com 16

8
27/03/2014

Introduction to NILabVIEW

ni.com
ni.com/students/learn-rio

Graphical System Design


A platform-based approach for measurement and control

ni.com 18

9
27/03/2014

Data Flow

ni.com 19

LabVIEW Getting Started Window

ni.com 20

10
27/03/2014

LabVIEW Getting Started Window

Additional support, tutorials, and explanations can all


be found using the links here. These are specifically
tailored to NI myRIO users.

ni.com 21

Create a Project
• Click the Create Project
button
• Select Blank Project.
• Click Finish.

• To save the project:


• File >> Save
• Select the desired directory
and choose a meaningful
name.
• Remember, two LabVIEW
projects cannot share the
same directory.

ni.com 22

11
27/03/2014

Group Activity
• Create and save a LabVIEW project.

Group Activity

ni.com 23

Project Explorer
• Find, access, and organize
project files

• Deploy or download files


to targets

• Manage code for build


options
• Executables, installers, and
zip files

ni.com 24

12
27/03/2014

Parts of a VI
VIs have three main components:

ni.com 25

Parts of a VI – Front Panel

The front panel is


constructed using
controls (inputs)
and indicators
(outputs).

ni.com 26

13
27/03/2014

Parts of a VI – Block Diagram

Front panel object


appear as
terminals on the
block diagram.

This is where
“programming” is
done in LabVIEW.

ni.com 27

Parts of a VI – Icon/Connector Pane

Icons and connector panes are necessary to use a VI as a


subVI.
o A subVI is a VI that appears on the block diagram of another VI.
o A subVI is similar to a subroutine or function in a text-based
programming language.

ni.com 28

14
27/03/2014

Exercise 1 – Building a LabVIEW VI in Windows


Temperature conversion from Fahrenheit to Celsius.

Group Activity

ni.com 29

NI myRIO Hardware Setup

ni.com

15
27/03/2014

Group Activity
• Plug in and power the NI myRIO.
• Power the NI myRIO with the AC to DC adaptor included in the
device’s packaging or a similarly rated power source.

• Connect the NI myRIO with a Male Type A – to – Male Type B


USB Cable.

• Click “Launch the Getting Started Wizard”

• Follow the prompts in the Getting Started Wizard

Group Activity

ni.com 31

Introduction to LabVIEW Real-Time

ni.com
ni.com/students/learn-rio

16
27/03/2014

What is Real-Time?
• Real-time does not always mean real fast
• Real-time means absolute reliability
• Hard Real-time systems have timing constraints
that must be met to avoid failure
• Determinism is the timing reliability of the
system

ni.com 33

Critical Applications to Consider

Event Response Closed-Loop Control Critical Tests

ni.com 34

17
27/03/2014

When General Purpose OSs Fall Short


• Design for fairness and user responsiveness vs.
strictly prioritizing tasks
• Focus on multitasking instead of maximum reliability /
uptime
• Not the result of bad products, only certain design
goals

ni.com 35

Key Careabouts for Critical Applications

• Jitter: execution time variability of a given operation or


application

2.8
Mean = 2.03 ms
2.1 2.1
2 Jitter
1.9
Execution 1.3
Time (ms)

Iterations

ni.com 36

18
27/03/2014

Key Careabouts for Critical Applications

• Determinism: a condition that is met if an operation or


application has bounded jitter

Bound (for hard


2.8 real-time
Mean = 2.03 ms systems)
2.1 2.1
2 Jitter
1.9
Execution 1.3
Time (ms)

…n
Iterations

ni.com 37

Running Real-Time Code – Modes


• “Real-Time Code” typically refers to VI’s running on a
target that are at processor level (non-FPGA).

• RT code can be run in two modes.


• Stand-alone
• Interactive Front Panel Mode

• In both modes, the code is deployed to the target (NI


myRIO) and is running on the NI myRIO processor.

ni.com 38
ni.com/students/learn-rio

19
27/03/2014

Exercise 2 – Investigate and Run Main.vi


• Create a project based on the myRIO project template.
• Open main.vi
• Features to understand:
• Flat Sequence Structure
• Wait (ms) function (loop refresh rate)
• Accelerometer Express VI

Group Activity

ni.com 39

NI myRIO Express VIs - Overview


• Express VIs are special VIs that allow the user to configure their settings
when placed on the block diagram.
• This avoids having to wire controls/constants to terminals taking up time and
block diagram space.

• NI myRIO has a palette of express VI that can be found by right-clicking on


the block diagram and navigating to myRIO.

ni.com 40

20
27/03/2014

NI myRIO Express VIs - Configuration


• When an Express VI is placed on the block diagram, a
configuration dialog box opens.
This is the Digital
Input Express VI.

More I/O
channels can be
accessed by
selecting Add Relevant
Channel. configuration
options are
shown in this
LabVIEW space.
generates G-code
with View Code.

ni.com 41

NI myRIO Express VIs – G-Code


• If the View Code button is selected in the configuration
dialog, LabVIEW will generate a window like this:
Copy to Clipboard
allows the user to
copy this code
into their VI if they
want to customize
options
programmatically.

ni.com 42

21
27/03/2014

Exercise 3 – Create RT code for NI myRIO


• Expand the functionality of the default Main.vi in the
default myRIO project.
• Features to learn:
• Creating space on the block diagram and resizing.
• Shift-Registers
• Boolean Palette Functions
• myRIO LED Express VI

Group Activity

ni.com 43

Introduction to LabVIEW FPGA

ni.com

22
27/03/2014

FPGA Technology

Programmable
Interconnects

Logic
Blocks

I/O Blocks

ni.com 45

FPGAs are Dataflow Systems

E F

Implementing
Logic on FPGA: A
B
F = {(A+B)CD} ⊕ E C
D

ni.com 46

23
27/03/2014

FPGAs are Dataflow Systems


Implementing Logic on FPGA: F = {(A+B)CD} ⊕ E

LabVIEW FPGA Code E F

A
B
C
D

ni.com 47

FPGAs are Parallel Dataflow Systems


E F

A
B
C
D
Z

W X Y

ni.com 48

24
27/03/2014

LabVIEW FPGA vs. VHDL

66 Pages ~4000 lines

I/O with DMA


ni.com 49

Why Are FPGAs Useful?


• True Parallelism – Provides parallel tasks and
pipelining

• High Reliability – Designs become a custom


circuit

• High Determinism – Runs algorithms at


deterministic rates down to 25 ns (faster in many
cases)

• Reconfigurable – Create new and alter existing


task-specific personalities
ni.com 50

25
27/03/2014

LabVIEW FPGA: How does it work?

Xilinx ISE
Compiler
Xilinx
FPGA
LabVIEW VI VHDL Bitfile Chip

LabVIEW LabVIEW
FPGA FPGA

ni.com 51

LabVIEW Programming and myRIO

Real-Time Reconfigurable
User Interface Processor FPGA

LabVIEW LabVIEW Real- LabVIEW FPGA


Time
ni.com 52

26
27/03/2014

Exercise 4 – Exploring the NI myRIO FPGA Shipping


Personality
• Explore the FPGA shipping functionality on NI myRIO.

Group Activity

ni.com 53
ni.com/students/learn-rio

Instructor Demo
Customizing the FPGA

ni.com 54

27
27/03/2014

Optional Instructor Demo


• Programming the Processor with C

ni.com 55

Resources and Next Steps

ni.com
ni.com/students/learn-rio

28
27/03/2014

NI myRIO Kits | ni.com/myrio

Starter Mechatronics Embedded


LEDs & switches DC gear motors/encoders RFID reader kit
7-segment display H-bridge driver Numeric keypad
Potentiometer Accelerometer LED matrix
Thermistor Triple-axis gyro Digital potentiometer
Photo resistor Infrared proximity sensor Character LCD
Hall effect Ambient light sensor Digital temp sensor
Microphone/Speaker Ultrasonic range finder EEPROM
Battery holder Compass
DC motor Hobby servo motors
ni.com 57

NI myRIO | Courseware

ni.com 58

29
27/03/2014

C Support for NI myRIO – ni.com/myrio/c-support

•Processor Programming
•Eclipse IDE
•C/C++ Support
•Free
•One Installer from ni.com

ni.com 59

Learn More About Programming NI myRIO

ni.com/learn-myrio

ni.com 60

30
27/03/2014

Learn More About Programming NI myRIO

ni.com/community/myrio

ni.com 61

ni.com

31

You might also like