Lab Handout #8: Interfacing myRIO (Reconfigurable IO)
Instructor: Engr. Veer Bhan
Name: UNSA JAN
CMS ID: 033-19-0048
Department of Electrical Engineering
ELE-321: Linear Control Systems for the semester Spring 2022
Rubrics for Marks Breakdown
Report Structure and
Methods, Results & Formatting, Figures and Total (Out of 10)
Discussion Captioning
70 % 30 % 100 %
Instructions:
1. The lab report has to be uploaded on the LMS (in pdf format) within a week.
2. Each lab report should have a title. Whereas, each task should be properly numbered and
have method, results, and discussion sections.
3. Appropriate picture of the block diagram or both with text (of suitable length) should be
used in the methods section.
4. Pictures (e.g., front panel or the hardware or both), tables, and graphs with appropriate
text should be used in the results section.
5. Discussion section only be used when deemed necessary, like explanation of results.
Page 1 of 14
Rubrics for Lab Reports BE-VI Spring 2022
S. Beginning Developing Competent Outstanding
Criteria
No. (40%) (60%) (80%) (100 %)
The student has Partial/incomplete A major portion of Methods have been
used incorrect methods, results, the methods, clearly outlined,
methods, provided their interpretation, results, important trends and
incorrect results, or interpretations, or data comparisons have
Methods,
their interpretation, comments/discussi comments/discussi been interpreted
Results, and
1. or on has provided by on has been correctly and
Discussion
comments/discussi the student. provided. However, discussed, a good
(70%)
on. This indicates a the section can be understanding of
lack of further improved results is conveyed
understanding. by putting more along with good
information. discussion.
Figures, tables, Figures, graphs, The figure, tables, Figures, tables, and/or
and/or graphs were and/or tables were and/or graphs were graphs were nicely
poorly (i.e., blurry, fine but contained good looking and presented with
no captions, no errors. The overall the overall report complete captions and
figure number) format was broken format was good the format was
Report constructed and and contained but still need some amazing.
2. Structure contained errors. grammatical and improvements.
(30%) The overall format contextual errors.
was out of order,
contained many
grammatical and
contextual errors.
Page 2 of 14
Lab Learning Outcomes
After completing this session, you should be able to program NI myRIO.
Your LabVIEW should have Control Design and Simulation and Math Module. The hardware
national instruments (NI) myRIO-1900 will be used in this lab.
Introduction
The NI myRIO is an embedded hardware device and industry proven technology that allows you
to design real time (RT) complex engineering systems more quickly, efficiently, and affordably.
myRIO is a powerful, portable, and LabVIEW programmable microcontroller. The RT and field
programmable gate array (FPGA) capabilities along with on-board memory and built-in WIFI
allow you to deploy applications remotely and run them “heedlessly” (without a remote
computer connection). The device can be connected with the host computer over USB and
wireless 802.11b, g.
Figure 1 Shape and features of NI myRIO-1900.
The internal architecture of myRIO consists of a 667 MHz dual-core ARM Cortex-A9
programmable processor and a customizable Xilinx FPGA and all in a sleek and simple
enclosure. NI myRIO-1900 has three connectors/ports (two NI myRIO expansion ports [MXP]
and one NI miniSystems port [MSP]). The Expansion Port (MXP) connectors A and B carry
identical sets of signals (pins). The signals are distinguished in software by the connector name,
as in ConnectorA/DIO1 and ConnectorB/DIO1.
The inputs and outputs of the NI myRIO expansion connectors (MXP) and the NI miniSystems
port (MSP) communicate with the processor through the FPGA.
Development Environment and Supporting Toolkits
The following software (development system) and toolkits are required to design and implement
real time systems using NI myRIO and LabVIEW.
Table 1. Development Systems and Toolkits
Page 3 of 14
S. No Development System and Toolkit
01 LabVIEW Development System - 2017
02 LabVIEW Control Design and Simulation Toolkit
03 LabVIEW Real-time Module / Tool kit
04 LabVIEW myRIO Tool kit
05 LabVIEW FPGA Module/Tool kit
06 LabVIEW math script RT module
07 Xilinx compilation Tools – Vivado 2015.4 for LabVIEW 2017
Note: All of these toolkits and software are available in NI Software Platform Buddle (SPB).
Hardware Setup: Connecting to the NI myRIO Device
To accomplish hardware setup, myRIO software provides a custom setup (SPB) and
configuration utility separate from the NI Measurement & Automation Explorer (MAX)
configuration utility. Once you have installed LabVIEW development system and all required
toolkits then it can be easily connected to host
computer through USB or Wi-Fi. Without
starting LabVIEW or NI MAX, if the device is
powered, the OS should recognize the NI
myRIO device and install and set up the drivers
for it. Once this is complete, in the Windows
OS, Windows should automatically launch the
NI myRIO USB Monitor shown in Fig 2.
This pop-up window indicates that myRIO
driver has been installed successfully.
This window is giving you some information
about your myRIO board like board type (NI
myRIO 1900), serial number and IP address.
This utility also allows you to test and
configure myRIO.
In order to test on board devices of myRIO,
click the first button which says “Launch the
Getting Started Wizard” and follow the
instructions.
Figure 2 myRIO USB monitor.
Now a new window will appear that is
showing the connected NI myRIO device, if you can’t see your device then click on
the ‘Refresh’ button. If your device is listed then press next.
When you press the Next button, a new window will pop up, here you can change the name
of your myRIO board, if you want but have left it as it is and clicked the Next button and
control window opened up as shown in Fig 2.
Finally, we have reached the control window, from this window we are can control all the
four LEDs labelled as LED0, LED1, LED2 and LED3 on myRIO, get notification for the
button pressed and will also get values for X, Y and Z coordinates from on-board gyroscope.
Page 4 of 14
Now you can click these buttons to turn your respective LED ON or OFF. Similarly, when you
press the button on your myRIO board then this black small circle will go green. Moreover, if you
change the orientation of your myRIO board then its axes values will also change.
Creating a myRIO Application
After successfully testing on-board devices, now set up an NI myRIO project from the project
templates included in LabVIEW 2017 for NI myRIO. After creating a default project, open the
default “Main.vi” and explore it in detail. Then complete an exercise on the functionality of the
default Main.vi. Real-time code runs on the processor built into the NI myRIO device. This code
can receive data from and send data to the FPGA using FPGA I/O nodes, Direct Memory Access
(DMA) FIFOs, and Express VIs that use the default FPGA.
Before programming with the myRIO, complete the following steps:
Click Create Project and then select the project from myRIO project Templates. Using
project, you can group together all the files relevant to your application
Press Next to configure details of the project like project name and the project root.
(Optional) In the File Name Prefix text box, enter a prefix that distinguishes the copy of the
template you create from additional copies of the template you create later.
In the Target section, right click the myRIO (on which to run your application) and then click
connect.
Click Finish. LabVIEW saves the project and opens the Project Explorer window.
Explore the Project Explorer window. For example, expand items in the project tree to find
Main.vi.
The myRIO contains an onboard accelerometer that measures the magnitude and direction of
acceleration. Complete the following steps to read acceleration values from the onboard
accelerometer and to display the acceleration values on a waveform chart.
Click run and deployment of code will be started (It may take some time when you are
deploying first time).
Rotate or shake the myRIO and observe the changes of the X, Y, and Z acceleration values
on the waveform chart.
Stop execution and Press Ctrl-E to switch to the block diagram of the Main VI. The block
diagram contains the graphical code of a VI. This VI uses the Accelerometer Express VI to
read acceleration values from the onboard accelerometer and uses the waveform chart
indicator to display the acceleration values.
The block diagram uses a Flat Sequence structure that executes the following frames from left to
right.
Initialize—Initializes the error in cluster to specific values.
Acquire and process data—Acquires acceleration values from the onboard accelerometer by
using the Accelerometer Express VI and displays the acceleration values by using a
waveform chart. The Main Loop repeats the code until you click Stop or an error occurs.
Close—Resets the onboard accelerometer before the application exits.
Tasks
Page 5 of 14
1. Create an application with three buttons each calling a VI.
a. VI-1 should be to create a flashing wave of the onboard LEDs, which can run
continuously. The user should be provided an option to control the flashing speed.
The VI should stop if the user presses the stop button on the front panel.
RESULTS: (FRONT PANEL)
Page 6 of 14
METHODOLOGY: (BLOCK DIAGRAM)
Page 7 of 14
Page 8 of 14
Q2:
VI-2 should turn an external LED on and off at regular intervals.
RESULTS: (FRONT PANEL)
Page 9 of 14
METHODOLOGY: (BLOCK DIAGRAM)
Page 10 of 14
Q3 :VI-3 should show the number 0 – 9 on an externally connected 7-segment
display.
RESULTS: (FRONT PANEL)
Page 11 of 14
Page 12 of 14
METHODOLOGY: (BLOCK DIAGRAM)
Q4: COMBINATION OF 1+2+3
ALL Vis in SINGLE Vi:
Page 13 of 14
Page 14 of 14