C Support for NI myrio 2.0 User Guide

Similar documents
System Overview and Terms

NI InsightCM Server Version 1.0

Getting Started with the LabVIEW Mobile Module

Getting Started with the LabVIEW Mobile Module Version 2009

NI Real-Time Hypervisor for Windows

Unpack and Install the Devices, Accessories, and Cables

NI-XNET Hardware and Software

DAQ Getting Started Guide

For Active Directory Installation Guide

NTP Software File Auditor for Windows Edition

Allworx OfficeSafe Operations Guide Release 6.0

Legal Notes. Regarding Trademarks KYOCERA Document Solutions Inc.

PowerPanel Business Edition Installation Guide

Integrated Virtual Debugger for Visual Studio Developer s Guide VMware Workstation 8.0

Bitrix Site Manager ASP.NET. Installation Guide

File Auditor for NAS, Net App Edition

Getting Started with the NI LabVIEW Embedded Module for ARM Microcontrollers

InventoryControl for use with QuoteWerks Quick Start Guide

Core Protection for Virtual Machines 1

Iridium Extreme TM Satellite Phone. Data Services Manual

QUANTIFY INSTALLATION GUIDE

Installing CaseMap Server User Guide

Symantec Backup Exec TM 11d for Windows Servers. Quick Installation Guide

VERITAS Backup Exec TM 10.0 for Windows Servers

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

Receiver Updater for Windows 4.0 and 3.x

Operating System Installation Guide

Installing S500 Power Monitor Software and LabVIEW Run-time Engine

Installation Guide. Novell Storage Manager for Active Directory. Novell Storage Manager for Active Directory Installation Guide

Windows Server Update Services 3.0 SP2 Step By Step Guide

LabVIEW Report Generation Toolkit for Microsoft Office

Legal Notes. Regarding Trademarks KYOCERA Document Solutions Inc.

NETWRIX EVENT LOG MANAGER

CONFIGURING MICROSOFT SQL SERVER REPORTING SERVICES

Crystal Reports Installation Guide

The cloud server setup program installs the cloud server application, Apache Tomcat, Java Runtime Environment, and PostgreSQL.

STATISTICA VERSION 10 STATISTICA ENTERPRISE SERVER INSTALLATION INSTRUCTIONS

Installation Notes for Outpost Network Security (ONS) version 3.2

TOSHIBA GA Printing from Windows

Intelligent Power Protector User manual extension for Microsoft Virtual architectures: Hyper-V 6.0 Manager Hyper-V Server (R1&R2)

Lepide Software. LepideAuditor for File Server [CONFIGURATION GUIDE] This guide informs How to configure settings for first time usage of the software

System Administration Training Guide. S100 Installation and Site Management

Image Backup and Recovery Procedures

FAS Asset Accounting FAS CIP Accounting FAS Asset Inventory SQL Server Installation & Administration Guide Version

Practice Fusion API Client Installation Guide for Windows

Symantec AntiVirus Corporate Edition Patch Update

NETWRIX EVENT LOG MANAGER

XFTP 5 User Guide. The Powerful SFTP/FTP File Transfer Program. NetSarang Computer Inc.

NSi Mobile Installation Guide. Version 6.2

File and Printer Sharing with Microsoft Windows

INSTALLATION GUIDE. AXIS Camera Station

User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream

ivms-5200 Professional Web Manager User Manual

Measurement Studio. Contents RELEASE NOTES

INSTALLATION AND CONFIGURATION GUIDE

Fleet Manager II. Operator Manual

HP Enterprise Integration module for SAP applications

VERITAS Backup Exec 9.1 for Windows Servers Quick Installation Guide

Ekran System Help File

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

Rev 7 06-OCT Site Manager Installation Guide

NetWrix Password Manager. Quick Start Guide

INSTALLING MICROSOFT SQL SERVER AND CONFIGURING REPORTING SERVICES

Using SSH Secure Shell Client for FTP

WS_FTP Professional 12

Mobility Services Platform Software Installation Guide

StrikeRisk v6.0 IEC/EN Risk Management Software Getting Started

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

Getting Started with WebEx Access Anywhere

HP LaserJet MFP Analog Fax Accessory 300 Send Fax Driver Guide

Installation and Operation Manual Portable Device Manager, Windows version

WhatsUp Gold v16.2 Installation and Configuration Guide

Using ESXi with PowerChute Business Edition

English ETERNUS CS800 S3. Backup Exec OST Guide

Dell UPS Local Node Manager USER'S GUIDE EXTENSION FOR MICROSOFT VIRTUAL ARCHITECTURES Dellups.com

Installing LearningBay Enterprise Part 2

Lepide Exchange Recovery Manager

GFI Product Manual. Outlook Connector User Manual

Install SQL Server 2014 Express Edition

Deploying Intellicus Portal on IBM WebSphere

Upgrading from Call Center Reporting to Reporting for Contact Center. BCM Contact Center

Installing the Android SDK

Features Reference. About Unified Communication System. Before Using This Machine. Starting a Meeting. What You Can Do During the Meeting

VERITAS NetBackup 6.0

etoken Enterprise For: SSL SSL with etoken

File Management Utility User Guide

Veritas Cluster Server Database Agent for Microsoft SQL Configuration Guide

19 Virtualization in ThinManager

Image Backup and Recovery Procedures

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

Universal Management Service 2015

CommandCenter Secure Gateway

VMware/Hyper-V Backup Plug-in User Guide

Sharp Remote Device Manager (SRDM) Server Software Setup Guide

Sage 300 ERP Sage CRM 7.1 Integration Guide

DeviceAnywhere Enterprise. ios Device Onboarding Guide

OfficeSuite CRM Connector Quick Start-Up Guide Version 1.0 May 2013

STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER

Personal Call Manager User Guide. BCM Business Communications Manager

Avalanche Remote Control User Guide. Version 4.1.3

Transcription:

C Support for NI myrio 2.0 User Guide C Support for NI myrio is designed for users who want to program the NI myrio by using non-labview programming languages, such as the C programming language. C Support for NI myrio includes the following components: C Support Contains header files, source files, and binary files for using the NI FPGA interface and NI-VISA interface on the NI myrio target. Examples Contains example projects that invoke the C support to use the resources on the NI myrio target. Template Contains a blank project configured with the required NI myrio settings. The template provides a starting point for using the C support. System Requirements One of the following operating systems: Windows 8/7/Vista Windows XP SP3 (32-bit) Windows Server 2008 R2 (64-bit) Windows Server 2003 R2 (32-bit) LabVIEW 2014 myrio Toolkit, which provides drivers and software for setting up the NI myrio target. Java, which is required for C/C++ Development Tools for NI Linux Real-Time 2014, Eclipse Edition. C/C++ Development Tools for NI Linux Real-Time 2014, Eclipse Edition, which provides both the Integrated Development Environment (IDE) and compilation tools. Installation Instructions You must perform the following tasks before developing an NI myrio application: Setting up the software environment Configuring the NI myrio target Importing C Support for NI myrio to Eclipse Installing FPGA bitfiles on the NI myrio target

Setting up the Software Environment 1. Install the myrio Toolkit. a. Visit ni.com/info and enter the Info Code myriotoolkit2014 to download the ISO image of the myrio Toolkit. b. Visit ni.com/info and enter the Info Code myriocsupport2014 to download myrio_c_support, which is the C support specification file for the myrio Toolkit. c. Note down the path to myrio_c_support on disk. d. On your operating system, open a command line window, enter <disk name>:\setup.exe <myrio c support path>, where <disk name> is your DVD drive disk and <myrio c support path> is the path to myrio_c_support on disk. e. Press <Enter> to run the command and launch the myrio Toolkit installer. f. Follow the instructions on the myrio Toolkit installer to complete the installation. 2. Install Java. Visit the Java website http://www.java.com/getjava to download Java. 3. Install C/C++ Development Tools for NI Linux Real-Time 2014, Eclipse Edition. Visit ni.com/info and enter the Info Code Eclipse2014 to download Eclipse. 4. Add the compiler path to the system environment variables. a. In the Windows Control Panel, select System and Security»System» Advanced system settings to display the System Properties dialog box. b. Click Environment Variables to display the Environment Variables dialog box. c. Select PATH in the User Variables for Administrator group box and click Edit. If PATH does not exist, click New to create one. d. Append the compiler path to Variable value. Delimit paths with semicolons. (Windows 32-bit): C:\Program Files\National Instruments\Eclipse\14.0\arm\sysroots\i686-nilrtsdkmingw32\usr\bin\armv7a-vfp-neon-nilrt-linux-gnueabi (Windows 64-bit): C:\Program Files (x86)\national Instruments\Eclipse\14.0\arm\sysroots\i686-nilrtsdkmingw32\usr\bin\armv7a-vfp-neon-nilrt-linux-gnueabi Note The compiler paths are customized for the 2014 version of Eclipse. If you use other versions of Eclipse, update the value to use the cross-compilers directory of Eclipse. 5. Click OK to close the dialog box and save changes. 2 ni.com C Support for NI myrio 2.0 User Guide

Configuring the NI myrio Target Complete the following steps to install software on the NI myrio target by using the Getting Started with NI myrio wizard: 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. Note down the IP address of the NI myrio target. 3. Click Launch the Getting Started Wizard and go through the wizard to install all required software to the NI myrio target and test your onboard devices. Note If you cannot install the required real-time software, verify that you specified the C support specification file when you installed the myrio Toolkit. Refer to the Setting up the Software Environment section of this document for information about how to specify the C support specification file. Note If the 2013 version of the software for NI myrio is installed on your NI myrio target, you need to upgrade to the latest software version to use the features described in this document. Use the Getting Started with NI myrio wizard to upgrade the software on your NI myrio target. After you install the software on the NI myrio target, complete the following steps to enable Secure Shell (SSH) on the NI myrio target by using the NI Web-based Configuration & Monitoring application: 1. On the host computer, open a Web browser and enter the following URL to launch NI Web-based Configuration & Monitoring: http://<ip address>/, where <IP address> is the IP address of your NI myrio target. 2. In the Startup Settings section, enable the Enable Secure Shell Server (sshd) checkbox. 3. Click Save at the top of the page. 4. Click Restart on the upper right corner of the page to restart the NI myrio target. Importing C Support for NI myrio to Eclipse Complete the following steps to import C Support for NI myrio to Eclipse: 1. Visit ni.com/info and enter the Info Code myriocsupportzip2014 to download C_Support_for_NI_myRIO_v2.0.zip. 2. Launch Eclipse, specify a workspace, and click OK to display the C/C++ perspective. 3. Select File»Import to display the Import dialog box. 4. Select General»Existing Projects into Workspace and click Next to display the Import Projects page. 5. Select Select archive file, click Browse and select the C_Support_for_NI_myRIO_v2.0.zip file. 6. Ensure that all items are checked and click Finish to import C Support for NI myrio to Eclipse. C Support for NI myrio 2.0 User Guide National Instruments 3

Note Projects that already exist in the workspace directory appear grayed out. Rename or delete the existing projects from the disk before you import them again. Installing FPGA Bitfiles on the NI myrio Target After importing C Support for NI myrio to Eclipse, establish a connection to install the FPGA bitfiles on the NI myrio target. Complete the following steps to establish a connection to the NI myrio target: 1. In Eclipse, select Window»Open Perspective»Other to display the Open Perspective dialog box. 2. Select Remote Systems Explorer and click OK to display the Remote Systems Explorer perspective. 3. Click the Remote Systems Explorer icon to display the Remote Systems pane. 4. Click the Define a new connection to remote system icon to display the New Connection dialog box. 5. Select General»Linux and click Next. 6. Enter the IP address of your NI myrio target in the Host name textbox and click Next to display the Files page. 7. Enable the ssh.files checkbox and click Next to display the Processes page. 8. Enable the processes.shell.linux checkbox and click Next to display the Shells page. 9. Enable the ssh.shells checkbox and click Next to display the Ssh Terminals page. 10. Click Finish. Your new remote system now appears 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 from the shortcut menu to display the Enter Password dialog box. 2. Enter the user ID and password for the NI myrio and click OK. By default, the user ID is admin and there is no password. 3. Click OK in the Info dialog box. 4. If the Keyboard Interactive authentication dialog box appears, enter the same authentication as step 2 and click OK. A green arrow appears on the target icon when the NI myrio is connected. 4 ni.com C Support for NI myrio 2.0 User Guide

Complete the following steps to install the FPGA bitfiles on the NI myrio target: 1. In the Remote Systems pane, right-click Sftp Files»Root and select New»Folder to display the New Folder dialog box. 2. Enter /var/local/natinst/bitfiles in the New folder name textbox and click Finish. Ignore the error if the folder already exists. 3. Right-click Sftp Files»Root»/»var»local»natinst»bitfiles and select Export From Project from the shortcut menu to display the Export dialog box. 4. Click C Support for NI myrio»source to display the files in C Support for NI myrio. 5. Select an FPGA bitfile. If your hardware is NI myrio-1900, select NiFpga_MyRio1900Fpga20.lvbitx. If your hardware is NI myrio-1950, select NiFpga_MyRio1950Fpga20.lvbitx. 6. Click Finish. Verify that the FPGA file that you select appears in the bitfiles folder. Using C Support for NI myrio with Eclipse for NI Linux Real-Time C Support for NI myrio includes examples and a template project. You can use the examples, whose names start with myrio Example, to build and deploy an example project to the NI myrio. Refer to the Examples Overview section of this document for more information about examples. You can use the template project, myrio Template, to build and deploy your own application. This section introduces how to build and deploy an example project and a template project and how to create a new project. Building and Deploying an Example Project Complete the following steps to build and deploy an example project: 1. Launch Eclipse in the C/C++ perspective. If Eclipse is not in the C/C++ perspective, select Window»Open Perspective»Other to display the Open Perspective dialog box, select C/C++ (default), and click OK. 2. In the Project Explorer pane, right-click an example and select Build Project from the shortcut menu to build the example. 3. Right-click the example and select Run As»Run Configurations to display the Run Configurations dialog box. 4. Expand C/C++ Remote Application and select the example to run. 5. Click Search Project to display the Program Selection dialog box. 6. Select the example in the Binaries section and click OK. 7. Click Apply and click Run. The example starts to run on the NI myrio target. You can find the result in the Console pane. 8. In the Project Explorer pane, right-click the example and select Debug As»Debug Configurations to display the Debug Configurations dialog box. 9. Expand C/C++ Remote Application and select the example to debug. 10. Click Search Project to display the Program Selection dialog box. C Support for NI myrio 2.0 User Guide National Instruments 5

11. Select the example in the Binaries section and click OK. 12. Click Apply and click Debug. The example runs on the NI myrio target with a debugger. You can find the debug tools on the toolbar of Eclipse. Note The default configuration of the project builds the debug mode for debugging. You can switch to the release mode by right-clicking the project and selecting Build Configurations»Set Active»2 Release from the shortcut menu. Building and Deploying Your First Project Complete the following steps to build and deploy your first project by using the template project: 1. Launch Eclipse in the C/C++ perspective. If Eclipse is not in the C/C++ perspective, select Window»Open Perspective»Other to display the Open Perspective dialog box, select C/C++ (default), and click OK. 2. In the Project Explorer pane, right-click myrio Template and select Rename from the shortcut menu to display the Rename Resource dialog box. 3. Specify a new name for your project and click OK. Note You must specify a new name for your project. Otherwise, you cannot import the myrio Template project again. 4. Right-click your project and select New»File to add your source files to the project. You can also reuse the source files in example projects by copying and pasting the source files into your project. 5. Right-click the project and select Build Project from the shortcut menu to build the project. 6. Right-click the project and select Run As»Run Configurations to display the Run Configurations dialog box. 7. Expand C/C++ Remote Application and select myrio Template. 8. In the Name textbox, enter the new name that you specified in step 3. 9. Click Search Project to display the Program Selection dialog box. 10. Select your project in the Binaries section and click OK. 11. Click Apply and click Run. The project starts to run on the NI myrio target. You can find the result in the Console pane. 12. Right-click the project and select Debug As»Debug Configurations to display the Debug Configurations dialog box. 13. Expand C/C++ Remote Application and select your project. 14. Click Search Project to display the Program Selection dialog box. 15. Select your project in the Binaries section and click OK. 16. Click Apply and click Run. The project starts to run on the NI myrio target with a debugger. You can find the debug tools on the toolbar of Eclipse. Note The default configuration of the project builds the debug mode for debugging. You can switch to the release mode by right-clicking the project and selecting Build Configurations»Set Active»2 Release from the shortcut menu. 6 ni.com C Support for NI myrio 2.0 User Guide

Creating a New Project C Support for NI myrio also includes a template project archive that you can use to create new projects for the NI myrio. The template project archive is included when you import C Support for NI myrio. Complete the following steps to create a new project: 1. Launch Eclipse in the C/C++ perspective. If Eclipse is not in the C/C++ perspective, select Window»Open Perspective»Other to display the Open Perspective dialog box, select C/C++ (default), and click OK. 2. Select File»Import to display the Import dialog box. 3. Select General»Existing Projects into Workspace and click Next to display the Import Projects page. 4. Select Select archive file, navigate to <workspace>\c Support for NI myrio\template project, where <workspace> is the workspace directory that you specify in Eclipse, and select the myrio Template v2.0.zip file. The myrio Template now appears in the Projects list. 5. Click Finish. Note Projects that already exist in the workspace directory appear grayed out. Rename or delete the existing projects from the disk before you import them again. Complete the Building and Deploying Your First Project section of this document to use this template project with the NI myrio. Examples Overview National Instruments provides the following 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 values in the three directions and prints the values to the console. AIIRQ Demonstrates using the analog input interrupt request (IRQ). This example registers an IRQ on analog input AI0 on connector A and creates a new thread that waits for the interrupt to occur. 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. ButtonIRQ Demonstrates using the button interrupt request. This example registers an IRQ on the user button of the NI myrio and creates a new thread that waits for the interrupt to occur. C Support for NI myrio 2.0 User Guide National Instruments 7

DIIRQ Demonstrates using the digital input interrupt request. This example registers an IRQ on digital input DI0 on connector A and creates a new thread that waits for the interrupt to occur. 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 I²C. This example reads the temperature from a connected TMP102 digital temperature sensor and writes the response to the console. PWM Demonstrates using pulse-width modulation (PWM). This example generates a PWM signal from PWM 0 on connector A. SPI Demonstrates using the sperial peripheral interface bus (SPI). This example writes a message to the SPI bus and then prints any returned bytes to the console. TimerIRQ Demonstrates using the timer interrupt request. This example registers an IRQ on software timer and creates a new thread that waits for the interrupt to occur. UART Demonstrates using the universal asynchronous receiver/transmitter (UART). This example writes a character to the UART bus and then prints any returned character to the console. 8 ni.com C Support for NI myrio 2.0 User Guide

Known Issues Connection Cancelled You might find that the connection to the NI myrio target sometimes cancels when you start to run or debug your project in Eclipse. The connection in Eclipse is not stable when you download your application to the NI myrio target. Click OK to dismiss the message. The connection reestablishes next time you download your application. You also can manually reestablish the connection in the Remote System Explorer perspective. A way to minimize the problem is to enable the Skip download to target path checkbox in the Run Configurations or Debug Configurations dialog box. However, you must then manually transfer the built executable to the NI myrio using SFTP. Using the NI myrio Target with LabVIEW To use the NI myrio target with LabVIEW, you must install LabVIEW and the LabVIEW Real-Time Module and then reinstall the myrio Toolkit. Refer to the readme of each product for specific system requirements and supported operating systems. Related Information NI myrio Shipping Personality Reference Contains information about the FPGA bitfiles included with C Support for NI myrio. C Support for NI myrio 2.0 User Guide National Instruments 9

Refer to the NI Trademarks and Logo Guidelines at ni.com/trademarks for more information on National Instruments trademarks. Other product and company names mentioned herein are trademarks or trade names of their respective companies. For patents covering National Instruments products/technology, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your media, or the National Instruments Patents Notice at ni.com/patents. You can find information about end-user license agreements (EULAs) and third-party legal notices in the readme file for your NI product. Refer to the Export Compliance Information at ni.com/legal/export-compliance for the National Instruments global trade compliance policy and how to obtain relevant HTS codes, ECCNs, and other import/export data. NI MAKES NO EXPRESS OR IMPLIED WARRANTIES AS TO THE ACCURACY OF THE INFORMATION CONTAINED HEREIN AND SHALL NOT BE LIABLE FOR ANY ERRORS. U.S. Government Customers: The data contained in this manual was developed at private expense and is subject to the applicable limited rights and restricted data rights as set forth in FAR 52.227-14, DFAR 252.227-7014, and DFAR 252.227-7015. 2013-2014 National Instruments. All rights reserved.