User Guide. Introduction. Requirements. Installing and Configuring. C Interface for NI myrio

Similar documents
C Support for myrio 5.0 User Guide

FX SERIES. Programmer s Guide. Embedded SDK. MN000540A01 Rev. A

How to configure the Matlab interface

Module 4: Working with MPI

Test/Debug Guide. Reference Pages. Test/Debug Guide. Site Map Index

Resource 2 Embedded computer and development environment

Pengwyn Documentation

Module 3: Working with C/C++

QUICKSTART CODE COMPOSER STUDIO Stellaris Development and Evaluation Kits for Code Composer Studio

Cisco Unified Serviceability

Labs instructions for Enabling BeagleBone with TI SDK 5.x

LTC Data Converter Board For The Arrow SoCKit Linux Application User s Guide

LiveNX Upgrade Guide from v5.1.2 to v Windows

External Headers. USB Host User LEDs. User Switches. E1 Header (Unfitted)

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

VIRTUALIZATION MANAGER ENTERPRISE EDITION GETTING STARTED GUIDE. Product: Virtual Iron Virtualization Manager Version: 4.2

UNic Eclipse Mini Tutorial (Updated 06/09/2012) Prepared by Harald Gjermundrod

FRC LABVIEW PROGRAMMING

VI-CENTER EXTENDED ENTERPRISE EDITION GETTING STARTED GUIDE. Version: 4.5

VIRTUALIZATION MANAGER ENTERPRISE EDITION GETTING STARTED GUIDE

Installation and Upgrade Guide Zend Studio 7.0

You have a PC with a USB interface, running Microsoft Windows XP (SP2 or greater) or Vista You have the Workshop Installation Software Flash Drive

The roborio web dashboard is a webpage built into the roborio that can be used for checking status and updating settings of the roborio.

Heterogeneous multi-processing with Linux and the CMSIS-DSP library

Contents. Anaplan Connector for MuleSoft

In this lab, you will build and execute a simple message flow. A message flow is like a program but is developed using a visual paradigm.

Getting Started with Eclipse/Java

Xilinx Vivado/SDK Tutorial

Installing and using CW 10.6 for TPMS applications. Revision 4

KYOCERA Net Admin Installation Guide

Configuring SAP Targets and Runtime Users

Managing Automation for SAP BOBJ Enterprise Processes

QSPI Flash Memory Bootloading In Standard SPI Mode with KC705 Platform

AndeSight. User Manual. Working with AndESLive. Version 1.0

Appendix A: Courseware setup

This document provides additional information for the installation and use of the Keithley I/O Layer.

IBM NetBAY Virtual Console Software. Installer and User Guide

Santa Fe (MAXREFDES5#) MicroZed Quick Start Guide

Using Eclipse for Java. Using Eclipse for Java 1 / 1

Installation of Actiheart Data Analysis Suite:

KYOCERA Net Admin User Guide

Hardware: Acquiring Data and Communicating with Instruments

Tegra 250 Development Kit Android Setup Experience

Wowza IDE 2. User's Guide

SAS Model Manager 2.3

Upgrade Tool Guide. July

DEVELOPING OOSIML SIMULATION MODELS. Using Codeblocks

Using Eclipse for C, MPI, and Suzaku

ncsa eclipse internal training

IMPLEMENTING SCL PROGRAMS. Using Codeblocks

Using the VMware vrealize Orchestrator Client

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

VIRTUALIZATION MANAGER SINGLE SERVER EDITION GETTING STARTED GUIDE

ConnectUPS-X / -BD /-E How to use and install SSL, SSH

Private/Public Saved Searches

GRLIDE. LEON IDE plugin for Eclipse User's Manual. The most important thing we build is trust GR-LIDE-UM. August 2016, Version 1.

SharePoint 2010 Instructions for Users

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2010

TriCore Free Entry Tool Chain. AURIX family and AUDO Future, AUDO MAX

CodeWarrior Development Studio for Power Architecture Processors Version 10.x Quick Start

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

Virtual Console Software. Installation and User s Guide

Microsoft Office Outlook 2007: Intermediate Course 01 Customizing Outlook

Contents. About This Guide... 2 Audience... 2 Revision History... 2 Conventions... 3 Definitions, Acronyms, and Abbreviations... 3

APPLICATION COMMON OPERATING ENVIRONMENT (APPCOE)

RTE for WIN32. Installation Manual (Rev.7.0) Midas lab

Laboratory Assignment #3 Eclipse CDT

1. Conventions in this tutorial Introduction Check and change configuration settings as needed Start Digi ESP...

UCS-E160DP Double-wide E-Series Server, 6 core CPU, with PCIe

DB2 for z/os Stored Procedure support in Data Server Manager

Installation and Upgrade Guide Zend Studio 9.x

NetBeans Tutorial. For Introduction to Java Programming By Y. Daniel Liang. This tutorial applies to NetBeans 6, 7, or a higher version.

Install Guide. Version 1.0 Demonstration. Copyright 2007 MGH

EUSurvey OSS Installation Guide

ActiveSpaces Transactions. Quick Start Guide. Software Release Published May 25, 2015

Installing Eclipse (C++/Java)

Installation Guide. Last Revision: Oct 03, Page 1-

SC-T35/SC-T45/SC-T46/SC-T47 ViewSonic Device Manager User Guide

Installation and Upgrade Guide Zend Studio 9.x

Intel System Studio for Microcontrollers

Colligo Engage Outlook App 7.1. Offline Mode - User Guide

Reset the Admin Password with the ExtraHop Rescue CD

At the shell prompt, enter idlde

Opening Microsoft Visual Studio. On Microsoft Windows Vista and XP to open the visual studio do the following:

Windows 2000 Safe Mode

Using Hypertext Transfer Protocol over Secure Sockets Layer (HTTPS)

CIS 231 Windows 10 Install Lab # 3

HPE Security Fortify Plugins for Eclipse

TIBCO LiveView Web Getting Started Guide

LiveNX Upgrade Guide from v5.2.0 to v5.2.1

Introducing HP NonStop Development Environment Version 2.0 for Eclipse (NSDEE 2.0)

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

Using SQL Developer. Oracle University and Egabi Solutions use only

IT Essentials v6.0 Windows 10 Software Labs

Hypertext Transfer Protocol over Secure Sockets Layer (HTTPS)

2. create the workbook file

XDS Connector. Installation and Setup Guide. Version: 1.0.x

5.5.3 Lab: Managing Administrative Settings and Snap-ins in Windows XP

Using Eclipse Che IDE to develop your codebase. Red Hat Developers Documentation Team :54:11 UTC

Transcription:

User Guide C Interface for NI myrio Introduction The C interface for NI myrio is designed for users who want to program the NI myrio using the C programming language or a programming language other than LabVIEW. The C interface for NI myrio includes the following components: C API Contains headers, source files, and binaries for calling the NI FPGA Interface and NI-VISA interface on the NI myrio target. Examples Contains examples files that invoke the C API to use the resources on the NI myrio target, which include accelerometer, AIO, DIO, encoder, I²C, PWM, SPI, and UART. Template Contains a blank project configured with required NI myrio settings. The template provides an easy starting point for using the C API. Requirements One of the following operating systems: o Windows 8 o Windows 7 o Windows Vista o Windows XP Pro (Service Pack 3) o Windows Server 2003 R2 (32-bit) o Windows Server 2008 R2 (64-bit) LabVIEW for myrio Module. The LabVIEW for myrio Module provides drivers and software for setting up the NI myrio target. Java x86 Runtime. Java is required for Eclipse for NI Linux Real-Time. Eclipse for NI Linux Real-Time. Eclipse for NI Linux Real-Time provides both the Integrated Development Environment (IDE) and compilation tools. Installing and Configuring You must perform the following tasks before developing an NI myrio application. 1. Set up software environment on the host computer 2. Configure the NI myrio target 3. Import the NI myrio C API to Eclipse 4. Install FPGA bitfiles on the NI myrio target

Setting up Software Environment 1. Install LabVIEW for myrio Module. 2. Install Java x86 Runtime. Download Java from http://www.java.com/getjava. 3. Install Eclipse for NI Linux Real-Time. 4. Add the compiler path to the system environment variables. 4.1. In Control Panel, click Environment Variables in System Properties >> Advanced tab. The Environment Variables dialog box appears. 4.2. Select PATH in User Variables and click Edit. Click New to create one if PATH does not exist. 4.3. Append the compiler path to the Variable value. The separator between paths is semicolon. 64-bit Windows: C:\Program Files (x86)\national Instruments\Eclipse\toolchain\ gcc-4.4-arm\i386\bin 32-bit Windows: C:\Program Files\National Instruments\Eclipse\toolchain\gcc-4.4- arm\i386\bin

Configuring the NI myrio Target Complete the following steps to use the Getting Started with NI myrio wizard to install software on the NI myrio target: 1. Connect the NI myrio to the host computer using a USB cable. The NI myrio USB Monitor appears after the driver is installed. 2. Take note of the IP address of the NI myrio target. 3. Click Launch the Getting Started Wizard and go through the wizard. The wizard installs all required software to the NI myrio target and tests the onboard sensors. After you install the software on the NI myrio, use NI Web-based Configuration & Monitoring to enable SSH on the NI myrio target by the following steps: 1. Navigate to http://<ip Address>/ in the web browser on the host computer. 2. Select Enable Secure Shell Server (sshd) in the Startup Settings section. 3. Click Save above the System Settings section. 4. Click Restart on the upper right of the page to restart the NI myrio target. Importing NI myrio C API to Eclipse Complete the following steps to import the NI myrio C API files to Eclipse: 1. Launch Eclipse, select your default workspace. 2. In Eclipse menu, click File>>Import. The Import dialog box appears. 3. On the Select step, select Existing Projects into Workspace. Click Next. 4. On the Import Projects step, select Select archive file. Click Browse and select the NI_myRIO_C_API_v1.0.zip file that you downloaded. 5. Now, a few items are added to the Project list. Keep all items checked and click Finish. Note: myrio C API is the base library and other projects dependency. Projects that begin with myrio Example are examples. myrio Template is for creating your custom project. Note: Projects that already exist in the workspace directory appear grayed. If you imported previously, you need to rename or delete those projects from the disk before you import again. Installing FPGA Bit Files After importing the NI myrio C API to Eclipse, create a connection to install the FPGA bitfiles on to the NI myrio Target. Complete the following steps to create a connection to the NI myrio target: 1. In Eclipse menu, click Window>>Open Perspective>>Other. Select Remote System Explorer and click OK. 2. In the Remote Systems pane toolbar, click Define a new connection to a remote system. The New Connection dialog box appears. 3. On the Select Remote System Type step, select Linux and click Next.

4. On the Remote Linux System Configure step, enter the Host name as <IP Address> (get from the NI myrio USB Monitor, usually 172.22.11.2) and click Next. 5. On the Files step, select ssh.files and click Next. 6. On the Processes step, select processes.shell.linux and click Next. 7. On the Shells step, select ssh.shells and click Next. 8. On the Ssh Terminals step, click Finish. Your new remote system now shows in the Remote Systems pane. Complete the following steps to connect to the NI myrio target: 1. In the Remote Systems pane, right-click the target and select Connect. The Enter Password dialog box appears. 2. Enter the password for the NI myrio and click OK. By default, the user ID is admin and there is no password. 3. Click OK on the Info dialog box. 4. The Keyboard Interactive authentication for... dialog box appears. Enter the same authentication as step 2 and click OK. 5. If the NI myrio target is connected, a green arrow shows on the target icon. Complete the following steps to install the FPGA bit files on the NI myrio target: 1. In the Remote Systems pane toolbar, expand Sftp Files and select New>>Folder on the Root shortcut menu. The New Folder dialog box appears. 2. Enter the folder name /var/local/natinst/bitfiles and click Finish. Ignore the error if the folder already exists. 3. In the Remote Systems pane, navigate to the newly created folder. Select Export From Project... in the bitfiles folder shortcut menu. The Export dialog box appears. 4. Expand the myrio C API, click source. If your hardware is NI myrio-1900, check NiFpga_myRIO1900FPGA10.lvbitx. If your hardware is NI myrio-1950, check NiFpga_myRIO1950FPGA10.lvbitx. Click Finish. 5. If succeeded, you see the NiFpga_myRIO1900FPGA10.lvbitx or NiFpga_myRIO1950FPGA10.lvbitx file in the bitfiles folder.

Using NI myrio C API with Eclipse for NI Linux Real-Time The NI myrio C API contains the following components: Examples you can build and deploy to the NI myrio. The template project you can use to build and deploy your own application. Examples and the template project are imported to Eclipse when you import the NI myrio C API to Eclipse. Building and Deploying an Example Project Complete the following steps to build and deploy an example project. See section Examples Overview for more information about examples. 1. Open Eclipse in the C/C++ perspective. If Eclipse is not in the C/C++ perspective, click Window>>Open Perspective>>Other in Eclipse menu, select C/C++ (default), and click OK. 2. In the Project Explorer pane, right-click the example project and select Build Project. Wait until the build finishes. 3. To run the example, right-click the project and select Run As>>Run Configurations. 4. In the Run Configurations dialog box, expand C/C++ Remote Application and select the project to run. On the right of the pane, click Search Project under the C/C++ Application and select the built binary. Click OK. Click Apply and click Run. 5. Now, the example runs on the NI myrio target and the result displays on the Console window. 6. To debug the example, right-click the project and select Debug As>>Debug Configurations. 7. In the Debug Configurations dialog box, expand C/C++ Remote Application and select the project to debug. On the right of the pane, click Search Project under the C/C++ Application and select the built binary. Click OK. Then, click Apply and click Debug. 8. Now, the example runs on the NI myrio target with debugger. The debug tools are on the toolbar. Note: The default builds Debug. You can switch to release by right-click the project and select Build Configurations>>Set Active>>Release. Building and Deploying Your First Project Complete the following steps to build and deploy your first project using the template project: 1. With Eclipse open in the C/C++ perspective. If Eclipse is not in the C/C++ perspective, click Window>>Open Perspective>>Other in Eclipse menu, select C/C++ (default), and click OK. 2. In the Project Explorer pane, right-click the myrio Template project and select Rename. Enter a meaningful name and click OK. Note: You must always rename the project. Otherwise you cannot import the myrio Template again. 3. Add your source files to the project. Code in myrio example projects is designed for reuse. You can copy source files from the example project to use in your application. 4. In the Project Explorer pane, right-click the project and select Build Project. Wait until the build finishes.

5. To run the project, right-click the project and select Run As>>Run Configurations. 6. In the Run Configurations dialog box, expand C/C++ Remote Application and select the project to run. On the right of the pane, rename the configuration to match the project name. Click Search Project under the C/C++ Application and select the built binary. Click OK. Click Apply and click Run. 7. Now, the project runs on the NI myrio target and the result displays on the Console window. 8. To debug the project, right-click the project and select Debug As>>Debug Configurations. 9. In the Debug Configurations dialog box, expand C/C++ Remote Application and select the project to debug. On the right of the pane, rename the configuration to match the project name (if not renamed yet). Click Search Project under the C/C++ Application and select the built binary. Click OK. Then, click Apply and click Debug. 10. Now, the project runs on the NI myrio target with debugger. The debug tools are on the toolbar. Note: The default builds Debug. You can switch to release by right-click the project and select Build Configurations>>Set Active>>Release. Creating a New Project The myrio C API project also includes a template project archive that you can use to start your additional projects for the NI myrio. The template project archive is included when you import the myrio C API project. Complete the following steps to create a new project: 1. With Eclipse open in the C/C++ perspective. If Eclipse is not in the C/C++ perspective, click Window>>Open Perspective>>Other in Eclipse menu, select C/C++ (default), and click OK. 2. In Eclipse menu, click File>>Import. The Import dialog box appears. 3. On the Select step, select Existing Projects into Workspace. Click Next. 4. On the Import Projects step, select Select archive file. Click Browse and browse to <WORKSPACE>\myRIO C API\template project and select the myrio_template_v1.0.zip file. Note: <WORKSPACE> varies by machines. The path is set when you launch Eclipse. 5. Now, the myrio Template item is added to the Project list. Click Finish. Note: Projects that already exist in the workspace directory appear grayed. If you imported previously, you need to rename or delete those projects from the disk before you import again. Complete the steps in Building and Deploying your First Project to use this template project with the NI myrio.

Examples Overview National Instruments provides the following eight examples for using the NI myrio. Refer to the main.c file in each example for more information. Accelerometer Demonstrates using the onboard accelerometer. This example reads the acceleration in the three directions and prints the values to the console. AIO Demonstrates using the analog input and output (AIO). This example reads initial values of two analog input channels from connector A and writes the sum of the read values on connector B. This example also prints the values to the console. DIO Demonstrates using the digital input and output (DIO). This example reads initial values of two digital input channels from connector A and writes the Boolean AND of the read values on connector B. This example also prints the values to the console. Encoder Demonstrates using the encoder. This example reads a step and direction signal from the encoder on connector B and prints the values to the console. I2C Demonstrates using the I2C. This example reads the temperature from a connected TMP102 digital temperature sensor and writes the response to the console. PWM Demonstrates using the PWM. This example generates a PWM signal from PWM 0 on connector A. SPI Demonstrates using the SPI. This example writes a message to the SPI bus and then prints any returned bytes to the console. UART Demonstrates using the UART. This example writes a character to the UART bus and then prints any returned character to the console.

Known Issues Connection Cancelled You might find the connection to the NI myrio target is cancelled sometimes when you start to run or debug your project in Eclipse. The connection in Eclipse is not stable when downloading your application to the target. Dismiss the message and the connection will be reestablished when downloading the next time. Or you can manually reestablish the connection in the Remote System Explorer perspective. A way to minimize the problem is to select Skip download to target path in the Run Configurations or Debug Configurations dialog box. However, you must then manually transfer the built executable to the NI myrio using SFTP. How to Use the NI myrio Target with LabVIEW To use the myrio target with LabVIEW, you need to install LabVIEW and the LabVIEW Real-Time Module to ensure required components are installed. You then reinstall the LabVIEW for myrio Module. Related Information NI myrio Shipping Personality Reference 2013 National Instruments. All rights reserved.