slide1 n.
Download
Skip this Video
Download Presentation
Decisions Behind the Design: LabVIEW for CompactRIO Sample Projects

Loading in 2 Seconds...

play fullscreen
1 / 41

Decisions Behind the Design: LabVIEW for CompactRIO Sample Projects - PowerPoint PPT Presentation


  • 157 Views
  • Uploaded on

Decisions Behind the Design: LabVIEW for CompactRIO Sample Projects. Meghan Kerry Embedded Software Product Manager Certified LabVIEW Developer (CLD). Agenda. Keys to quality in a software architecture Software architecture overview I/O safe states Watchdog timers Message communication

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Decisions Behind the Design: LabVIEW for CompactRIO Sample Projects' - wilson


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
decisions behind the design labview for compactrio sample projects

Decisions Behind the Design: LabVIEW for CompactRIO Sample Projects

Meghan Kerry

Embedded Software Product Manager

Certified LabVIEW Developer (CLD)

agenda
Agenda
  • Keys to quality in a software architecture
  • Software architecture overview
  • I/O safe states
  • Watchdog timers
  • Message communication
  • Error handling
  • System monitoring
keys to quality in a software architecture
Keys to Quality in a Software Architecture
  • Define software architecture and identify architecture components
  • Create an architectural diagram
  • Consider key components such as data communication, error handling, etc.
  • Learn the foundational design patterns
  • Create new design patterns as required by your application (requires experience)
data communication diagram
Data Communication Diagram
  • Documents foundational components:
    • Processes (loops)
    • Data communication paths
    • Type of data transfer
labview for compactrio sample projects
LabVIEW for CompactRIO Sample Projects
  • Pre-built architectures for embedded control and monitoring applications
  • Designed to ensure quality and scalability of a system
basic fpga diagram
Basic FPGA Diagram

Performs deterministic and/or high speed control

failure conditions that initiate safe states
Failure Conditions that Initiate Safe States
  • Examples (from Fail Safe Reference Design):
    • RT Safe – indicates the RT system is ready
    • Emergency Safe – tied to an emergency shut-off switch
    • Watchdog Safe – monitors the Real-Time system
    • Control Inputs Valid – monitors the inputs to the control algorithm
  • Based on system requirements
basic fpga diagram1
Basic FPGA Diagram

Detects software failures

Recovers from software failures

watchdogs
Watchdogs
  • A watchdog timer is a hardware counter that interfaces with the embedded software application to detect and recover from software failures
  • A user can then:
    • Reboot real-time target automatically
    • Perform user-defined recovery actions
  • Two types of watchdogs with NI Real-Time hardware:
    • LabVIEW Real-Time Watchdog
    • Real-Time <-> FPGA Watchdog (FPGA Fail Safe Design)
labview real time only watchdog
LabVIEW Real-Time Only Watchdog
  • Uses hardware timer built into CompactRIO hardware
  • “Reset = True” reboots system if the watchdog process is starved
labview real time watchdog
LabVIEW Real-Time Watchdog
  • Enable occurrence in expiration actions
  • Configure appropriate watchdog timeout and Watchdog Whack loop period
real time fpga watchdog
Real-Time <-> FPGA Watchdog

Reset timer

Put control loop into a safe state, and reset system

real time fpga watchdog1
Real-Time <-> FPGA Watchdog
  • Pet the watchdog at a user-defined watchdog pet rate
  • This resets the counter implemented in the FPGA VI

See Fail-Safe Control Reference Design whitepaper

basic fpga diagram summary
Basic FPGA Diagram - Summary

Detects software failures

Recovers from software failures

Performs deterministic and/or high speed control

basic real time processor diagram
Basic Real-Time Processor Diagram

Communicates messages with client

Sends messages to other processes or targets

Periodically communicates tags

constructing a message
Constructing a Message

Examples

Data

Variant allows data-type to vary. Different messages may require different data

Command

String constant allows user to specify message

queued message handler framework
Queued Message Handler Framework

Command Parser

Queued Message Handler Setup

Message handling loop

Watchdog Loop

Monitoring Loop

queued message handler framework1
Queued Message Handler Framework

One or more messages handled per case

Command Parser

Communicate messages between processes or targets

Watchdog Loop

Monitoring Loop

basic real time processor diagram1
Basic Real-Time Processor Diagram

Handles all error messages from FPGA and RT target

error messages
Error Messages
  • Specific Error Handling
    • Code called in specific locations to respond with an action to specific error codes
    • Possible actions are retry, ignore, correct
  • Central Error Handling
    • High-level code that checks for errors in an entire system
    • Responds to classes of errors rather than specific codes
    • Uses the classification to determine which actions to take

Queue

Central Handler

central error handling framework
Central Error Handling Framework

Command Receiver Loop

Specific Handler

UI message handling loop

Watchdog Loop

Specific Handler

Monitoring Loop

Specific Handler

central error handling framework1
Central Error Handling Framework

Command Receiver Loop

Specific Handler

Watchdog Loop

Specific Handler

Monitoring Loop

Specific Handler

central error handling framework2
Central Error Handling Framework

Return classification of error

Handle classified errors (update FPGA state and/or reboot system)

Get next error based on priority

Log and send all errors to UI

basic real time processor diagram2
Basic Real-Time Processor Diagram

Communicates messages with client

sending commands across the network
Sending Commands Across the Network
  • Network Streams are great for commands because are they are lossless
  • Tips:
    • Use Flush with zero timeout to minimize latency
    • Add code to handle UI disconnections (see Sample Project)
system monitoring
System Monitoring

Embedded processors have limited….

Disk Space

RAM

CPU Bandwidth

LostData

Crash

Starvation

EFFECT

system monitoring1
System Monitoring

Current value data can be sent to UI with Shared Variables

Monitor CPU usage per core

Execute loop periodically

network published shared variables
Network Published Shared Variables
  • When to use the Static API:
    • Small number of variables (less than a dozen)
  • When to use the Programmatic API:
    • Iterate through a large number of variables
    • Dynamically change the IP address of the cRIO from the client (client side only)
basic real time processor diagram3
Basic Real-Time Processor Diagram

Communicates messages with client

Sends messages to other processes or targets

Periodically communicates tags

basic hmi diagram
Basic HMI Diagram

Processes UI Events and communicates messages with real-time system

Generates UI Events using the Event Structure

Periodically updates UI

common variant architectures
Common Variant Architectures
  • Other LabVIEW for CompactRIO Sample Projects
    • LabVIEW FPGA Control
    • LabVIEW FPGA Control with Real-Time Sequencer Engine
    • LabVIEW Real-Time Control (RIO Scan Interface)
    • LabVIEW FPGA Waveform Acquisition and Logging
    • LabVIEW Data Logging and Supervisory Control
labview for compactrio sample projects1
LabVIEW for CompactRIO Sample Projects
  • Available in LabVIEW 2012 and later
  • Find more best practices at ni.com/compactriodevguide
ad