Best Practices for Deploying, Replicating, and Managing Real-Time and FPGA Applications
System Deployment System Replication Configuration Mgmt. System Monitoring System Updates 2
Agenda Preparing for Deployment Update Deployment Methods Methods 3
1: Prepare for Deployment Verifying Resource Utilization Configuring Target for Deployment 4
Verifying Resource Utilization Disk Utilization Guideline: Keep disk utilization under 80% CPU Load Guideline: Keep CPU load under 80% Memory Usage Ensure largest contiguous memory doesn t decrease 5
Resource Utilization: Disk Space MAX System Monitor Get Volume Info VI 6
Resource Utilization: CPU & Memory Distributed System Manger for CPU and Memory Usage System State Publisher must be installed to controller Get CPU Loads VI System API to get Memory Use 7
Configuring for Deployment Use Recommended Software Set installations (RSS) Uninstall unused components Improves system security and performance 8
Demo 1: RSS 1. See software list for Custom Software Install 2. See software list for RIO 4.0 RSS 3. Compare RSS to Custom Software Install 9
2: Deployment and Replication Configuration management LabVIEW Project based deployment FPGA flash deployment Imaging-based deployment Advanced: component-based deployment 10
Configuration Management Packets of information about units in a system Track historical hardware and software versions/data Information on host vs. information on a target Useful for tracking system state at any time 11
System Information Packet Meta Information Properties RT Controller Information Application EXE Controller Configuration Driver Software Set Other Application Files Network Settings FPGA Configuration 12
LabVIEW Project Based Deployment Deployment will refer to deploying executable and/or compiled bitfile Benefits of a Real-Time Application Executable (RTEXE) Embedded application: Can launch on system startup/boot Improved execution performance Improved system security 13
LabVIEW Project Based Deployment After development is complete, build a Real-Time Application (RTEXE) for deployment Requires development environment and source code Can set RTEXE as a startup executable 14
Demo 2: LabVIEW Project Based Deployment 1. Build the RT LED Application 2. Deploy the RTEXE as a startup executable 15
LabVIEW Project Based Deployment What happens to FPGA code when deploying RTEXEs? How are the startup states for FPGA I/O controlled? 16
Open FPGA VI Reference Timing Device powered RTEXE loads RTOS loads FPGA loads FPGA I/O state uncontrolled 17
FPGA Deployment Two methods to deploy an FPGA bitfile: 1. Host can load bitfile with Open FPGA VI Reference.vi 2. Load independently into FPGA flash memory 1 2 Host VI/Executable FGPA Application FGPA Application 18
RIO Hardware Architecture Overview FPGA Flash Processor FPGA Fabric I/O Real-Time or Host FPGA 19
FPGA Deployment: Host Reference Bitfile is saved in host application with Open FPGA VI Reference.vi In execution, Open FPGA function checks if bitfile is loaded and loads if not already loaded Caveat: bitfile isn t loaded and run until OS and application load 20
FPGA Deployment: FPGA Flash Alternative is to deploy FPGA bitfile to flash Right Click the FPGA Target in the project and select RIO Device Setup Programmatically, use NI-RIO System Replication VIs found on NI Developer Zone (Title: FPGA Target System Replication) Set RIO Device Settings.vi Download Bitfile.vi 21
FPGA Deployment Bitfile can run on device power up and/or reboot: Note: Must compile with Run when loaded to FPGA checked (not default) RTEXE can still connect to FGPA bitfile 22
FPGA Flash Deployment Timing Device powered; FPGA bitfile runs RTEXE loads RTOS loads RTEXE connects with FPGA FPGA I/O state controlled 23
Demo 3: FPGA Flash Deployment 1. Deploy FPGA bitfile to flash 2. Observe power-up and boot behavior 24
IDE Deployment May involve some or all of: Discover the target in MAX Apply network settings Install all necessary drivers Open the development project Change project IP Address Build the application EXE Deploy the application Manual FPGA Flash deployment 25
IDE Deployment What about project-based deployment in the context of: 1. 2. 3. 4. 26
Imaging 1. Deploy built application to a controller from project 2. Create Disk Image from this controller Image packages every file on the controller hard drive in a zip file saved on the host machine 3. Deploy that image to one or more targets 1 2 3 27
2012 New Features: NI System Configuration API 30% faster at deploying images Support for parallel deployment of images Parallel Image Deployment Ability to get progress information during imaging Additional options for network settings File/Folder blacklisting for system imaging File & Directory Blacklisting Improved web based configuration for remote devices Supported on Windows and RT 28
2012 Real-Time Image Deployment Improvements Parallel image deployment to targets 30 % faster image retrieval and deployment File and directory blacklist option Improved and expanded web configuration Parallel Image Deployment File & Directory Blacklisting 29
Imaging Provides an exact copy of a system Easily deployed to multiple targets Reduced risk of deployment error (fewer steps) Can be used as restore points/as backups Development environment not required Must deploy images to the same controller model Existing configuration or log files on target controller can get deleted Upgrades can be slower than necessary Doesn t handle FPGA Flash deployment 30
Imaging Packet Information Meta Information Properties RT Controller Information Application EXE Controller Configuration Driver Software Set Other Application Files Network Settings FPGA Configuration 31
Replication and Deployment (RAD) Utility Open source image-based deployment utility Use as-is or as a starting point for a custom solution 32
RAD: Image Management Retrieve Deploy 33
RAD: File/Folder Blacklisting 34
RAD: Target Configuration NI Auth Integration Easier network settings 35
RAD: Image Comparison RAD can perform a file-by-file checksum comparison between images Can identify which files are different 36
Demo 4: RAD 1. RAD user interface 2. RAD get image function 3. RAD retrieve blacklist functionality 4. RAD deploy image function 37
RAD Feature Recap Retrieve and deploy images Select multiple targets for image deployment Configure deployment network settings FPGA flash deployment (uses RIO Replication Tools) Image versioning File-by-file image comparison tool for validation For downloads and documentation: NI Developer Zone: Replication and Deployment (RAD) Utility 38
RAD Packet Information Meta Information Properties RT Controller Information Application EXE Controller Configuration Driver Software Set Other Application Files Network Settings FPGA Configuration 39
Imaging APIs System Configuration API Released in 2010 Active R&D development RT Utilities API No new development, deprecated in 2012 40
System Configuration API In Measurement I/O Palette and Real-Time Palette 41
System Configuration API Session-based (Open Read/Write Close) Uses both VIs and Property/Invoke Nodes Examples in Example Finder 42
Application Components RT Application is built into a system component Allows specification of driver dependencies for application 1. Setup in configuration of the RTEXE build in the project 2. Components are installed from MAX or programmatically with System Configuration API to targets 1 2 43
Application Components Benefits Multiple target types supported components Shorter deployment times Built from the project no retrieval required Built in versioning Integrates into MAX For niche uses: rapid update timeframe, high data cost 44
Application Components Limitations Characteristic Dependencies can change due to new driver installs* Project configurations cannot be deployed Impact Components are not safe as-is for defining restore points Cannot natively deploy Shared Variables or handle Custom Scan Engine Settings Component sharing requires entirety of RT Images folder Limits portability of components to other update/deployment host machines *If RSS is not used in setting up driver installation on the target 45
Application Components 46
Application Components Deployment MAX works as a GUI to install components to targets 47
Application Components Deployment System Configuration API to programmatically deploy Component Definition File /National Instruments/RT Images/User Components/[Project Name]/[Target Name]/[Build Specification Name]/[Version #] Distribute RT Images Folder to other machines if necessary 48
Demo 5: Components 1. Build RTEXE into an application component 2. Install application component using MAX 49
Component Packet Information Meta Information Properties RT Controller Information Application EXE Controller Configuration Driver Software Set Other Application Files Network Settings FPGA Configuration 50
For Comparison: Imaging Meta Information Properties RT Controller Information Application EXE Controller Configuration Driver Software Set Other Application Files Network Settings FPGA Configuration 51
For Comparison: RAD Meta Information Properties RT Controller Information Application EXE Controller Configuration Driver Software Set Other Application Files Network Settings FPGA Configuration 52
Comparison: RAD and Components Imaging copies the whole; components update parts Different uses for each method and they can be combined Recommendation: Use imaging (easier and less complex) RAD (Imaging based) Must deploy to same model controller Slower deployment but vetted stack; can verify deployment Packets can serve as restore points and are portable Components Controller agnostic Faster deployment but room for user error; verification more difficult Packets are less portable and there is risk in using them as restore points 53
3: Update Methods 1. Remote Imaging 2. USB Deployment 54
Update Methods: Remote Imaging Developer can build the RAD into a custom installer (DevZone provides source for RAD) Developer can take an image and send file to client Client can load and apply image on local machine with custom installer at remote site Developer Site Client Site 55
Update Methods: USB Memory Device Image-based solution Use: RIO target not available over the network Store an update image on USB device Plug USB device into controller to be updated Controller reboots Original and updated application images check for a USB device at startup and update if a new image is found Reference Design for Deploying CompactRIO Application Updates using a USB Memory Device 56
Summary Deployment ready application Method Imaging Traditional Deployment Application Components API RT Utilities System Configuration Tool RTAD RAD Custom Build 57
Takeaways RAD is the 90% use case for advanced deployment Application components address niche cases and are not yet recommended for common use Visit the crio Developer s Guide to refresh and for additional content such as licensing 58
crio Information Library (CRI) Returns backplane and module serial # s, model # s, etc. Deploys a bitstream to the FPGA to return module data Used as a component in the RTAD Reference Library for Reading crio System Configuration Information (CRI) 59
Configuration Management: RT Application Licensing Reference Design Technique to limit the hardware than an RTEXE executes on 1. License Key is generated from hardware serial numbers and then encrypted 2. License Key is then distributed with the RT Application 3. Distributed application cross checks hardware serial numbers with license key at startup Reference Design for Adding Licensing to LabVIEW Real-Time Applications 60