Real Time Programming with LabVIEW - PowerPoint PPT Presentation

About This Presentation
Title:

Real Time Programming with LabVIEW

Description:

Current RT hardware targets. Using LabVIEW RT. Advanced ... Multithreaded LabVIEW. ni.com. Exec( ) Thread. RT Computer. Communication. Loop. Exec() Thread ... – PowerPoint PPT presentation

Number of Views:1279
Avg rating:3.0/5.0
Slides: 56
Provided by: jha112
Category:

less

Transcript and Presenter's Notes

Title: Real Time Programming with LabVIEW


1
Real Time Programming with LabVIEW RT
John Limroth Software Engineer Thurs Aug
17 1015-115 p.m., 145-445 p.m. Exhibit (3G)
2
Agenda
  • LabVIEW RT basics
  • Current RT hardware targets
  • Using LabVIEW RT
  • Advanced programming techniques
  • Software/hardware watchdogs
  • Application builder

3
What is Real-time?
  • Real-time does NOT mean real fast!
  • Requires deterministic response
  • Windows does NOT guarantee determinism

4
RT Hardware Architecture
5
LabVIEW RT Software
  • LabVIEW RT adds two extra components to regular
    LabVIEW
  • The RT Development System
  • Part of it runs on host PC
  • Programming and debugging LabVIEW code
  • The RT Engine
  • Runs on target
  • Executes embedded code
  • Independent of host PC

6
Software Architecture
  • Three separate instances of LabVIEW

7
Software Architecture
(Instance B)
(Instance C)
8
Agenda
  • LabVIEW RT basics
  • Current RT hardware targets
  • Using LabVIEW RT
  • Advanced programming techniques
  • Software/hardware watchdogs
  • Application Builder

9
RT Series DAQ Devices
  • Hardware
  • Processor
  • 486 133 MHz AMD chip
  • Memory
  • 8 MB of DRAM for LabVIEW executable and
    NI-DAQ.dll
  • 1 kB of SRAM for shared memory
  • Two user-defined LEDs

10
RT Series DAQ Devices
  • Form Factors
  • Single product based on DAQ devices
  • 7030/6040E 16 channel, 12-bit resolution, 250
    kS/s
  • 7030/6030E 16 channel, 16-bit resolution, 100
    kS/s
  • 7030/6533 32 high-speed digital lines
  • Single PCI slot
  • Double PXI slot
  • All SCXI and accessories supported

11
Installing the RT Series DAQ Card
  • Installed and seen in MAX
  • RT intelligent card has one device number
  • Daughter card has separate device number
  • No test panels

12
RT PXI Controller
  • General description
  • Connected through Ethernet
  • Pre-loaded RTOS and software
  • Available with LV RT 5.1.2 and NI-DAQ 6.7
  • PXI-8156B (233 or 333 MHz) must be configured
  • Communication
  • Default user interface thread
  • VI Server
  • TCP/IP

13
RT PXI Hardware
  • Supported hardware
  • All PXI chassis without monitors
  • All of regular NI-DAQ
  • MXI-3
  • Configure your own system

14
Remote System Explorer
  • Configures system
  • Installs or upgrades software
  • Creates utility disks
  • Lists installed software or hardware

15
Installation Procedure
  • Ensure the system is ready to be configured
  • Must reside on same subnet
  • Run the uninstall disk if questionable
  • Create boot floppy (RT system specific)
  • Reboot system with floppy installed
  • IP 0.0.0.0
  • Serial number is from Ethernet chip set

16
Installation Procedure (cont.)
  • Assign IP address, name, password, etc
  • Password is optional
  • Reboot system
  • Upgrade/download software
  • Choose install script
  • Verify software versions
  • Reboot system
  • RT system is ready

17
Exercise 1 Configuring a PXI Controller
18
File Structure
  • Viewable through Windows OS
  • Ph_exec.exe and ni-rt.ini in root directory
  • Embedded PXI File Structure (c\ni-rt\)
  • \system\ includes emblview.exe, ni-daq.dll, etc
  • \startup\ includes boot up executables

19
Useful Tools in MAX
  • Remote DAQ Configuration
  • Sets the properties of the remote DAQ boards
  • Also available through Remote System Explorer
  • Remote Device Access
  • RDA Server enabled on RT Series PXI controller
  • Allows user to test the board with test panels

20
Exercise 2 Troubleshooting RT Series PXI
controller
21
Agenda
  • LabVIEW RT Basics
  • Current RT hardware targets
  • Using LabVIEW RT
  • Advanced programming techniques
  • Software/hardware watchdogs
  • Application Builder

22
Embedding a VI Step 1
  • Select target platform
  • Host
  • RT intelligent card
  • PXI controller on network

23
Embedding a VI Step 2
  • Download code on target

24
Embedding a VI Step 3
  • Exit without closing RT Engine

25
Exercise 3 Download a VI
26
Shared Memory
  • Incremental read/write high-level continuous
    transfer of array of singles
  • Read/write VIs incorporates a flag (8-bit word)
    to make reading and writing more efficient
  • Low-level peeks and pokes basic building blocks
    for other levels

27
VI Server
  • Similar to normal VI Server
  • Different machine name that corresponds to RT
    Series Intelligent Card device number (DAQ1)
  • Requirements
  • VI must be loaded in memory
  • LabVIEW RT must be running on target

28
Download Application
  • Loads VI into dynamic memory without running it
  • VI is now ready to run (Download bar will not
    appear)

29
LabVIEW RT Running on Target
  • Important aspect of VI Server
  • Exit without closing RT Engine VIs
  • Keeps LabVIEW RT open
  • Closes user interface

30
Exercise 4 Using VI Server
31
TCP/IP with LabVIEW RT
  • Similar to regular LabVIEW
  • Requires different machine names to correspond to
    Intelligent DAQ Cards (DAQ1)
  • Used to communicate large chunks of data
  • Not deterministic

32
Exercise 5 Using TCP/IP
33
Agenda
  • LabVIEW RT basics
  • Current RT hardware targets
  • Using LabVIEW RT
  • Advanced programming techniques
  • Software/hardware watchdogs
  • Application Builder

34
Programming Tips Timing
  • Keep unnecessary computations outside of the
    time-critical loop
  • Keep configuration VIs outside of the loop
  • Sleep mode helps maintain loop rates while
    allowing other loops to share time

35
Programming Tips Memory
  • Determinism
  • Pre-allocate arrays
  • Avoid shared resources
  • Performance
  • Cast data to the proper type
  • Inplaceness
  • Global Variables

36
Exercise 6 Reducing the Jitter in a LabVIEW RT
Program
37
Single-Threaded LabVIEW
Computer
Thread
Co-routines
User Interface Loop
Exec( )
38
Multithreaded LabVIEW
Computer
Messages
Thread
UI Loop Exec()
39
LabVIEW RT Target System
RT Computer
Messages
Thread
Communication Loop Exec()
TCP/IP
40
LabVIEW RT Deployed System
-Shared memory -TCP/IP -VI server
RT Series hardware target
Host PC
Thread
Thread
Communication Exec()
UI Loop Exec()
41
Understanding Priorities
  • Normal priority
  • Allows the CPU to be shared
  • Time-critical priority
  • 100 of CPU time
  • Sleep mode is very important
  • Subroutine priority
  • Highest priority level
  • Releases thread only when done

42
Exercise 7 Understanding Priorities
43
Agenda
  • LabVIEW RT basics
  • Current RT hardware targets
  • Using LabVIEW RT
  • Advanced programming techniques
  • Software/hardware watchdogs
  • Application Builder

44
Watchdogs
  • Hardware or software mechanism that checks the
    status of the embedded system
  • Increases the systems robustness
  • Generally requires a low overhead

45
Software Watchdog
Host PC
  • Software watchdog can use the shared memory
  • One side writes a value that is constantly
    changing
  • Both host PC and embedded PC can implement
    watchdogs

(?)

1K
(?)
Embedded PC
46
Hardware Watchdog
  • Digital/counter lines can be used to trigger
    other systems

External System 1
(?)

External System 2
(?)
Embedded PC
CTR/DIO
47
Built-in Hardware Watchdog API
  • Extra hardware counter/timer
  • Continuously counts down
  • Software continually resets the counter
  • Can be configured to take action
  • Reset PXI System
  • Set Occurrence
  • Trigger

48
Exercise 8 Implementing a Hardware Watchdog
49
Agenda
  • LabVIEW RT basics
  • Current RT hardware targets
  • Using LabVIEW RT
  • Advanced programming techniques
  • Software/hardware watchdogs
  • Application Builder

50
Application Builder
  • Usually targeted to host PC
  • Extra RT options
  • Show RT target selection dialog
  • Quit RT boot application after downloading

51
Targeting to the PXI Controller
  • Able to save executable to disk
  • Remove serpdrv
  • App Settings Tab is disabled

52
Networked Preferences
  • Application Builder (when connected to TARGET)
  • Default name Startup.exe (C\ni-rt\startup)
  • NETWORKED PREFERENCES-gtRT Target Miscellaneous
  • Install path
  • Name must be 8.3

53
Command Line Arguments
  • Used to alter execution
  • Ex c\mybuiltapp.exe target DAQ1 reset
    quithost

RT Series DAQ device RT Series PXI system
-target DAQ1 130.164.48.51
-reset Resets device not available
-quithost Exits without closing RT Engines Exits without closing RT Engines
54
Exercise 9 Using Application Builder
55
End of LabVIEW RT Hands-onQuestions?
Write a Comment
User Comments (0)
About PowerShow.com