Data Acquisition Practical Session

51
1 Data Acquisition Practical Session Antonios Vandoulakis Technical Sales Engineer [email protected]

Transcript of Data Acquisition Practical Session

1

Data Acquisition Practical Session

Antonios Vandoulakis Technical Sales Engineer [email protected]

2

Agenda •  Brief introduction to NI and LabVIEW

o  Exercise 1 – Working with LabVIEW •  Brief introduction to CompactDAQ architecture

o  Exercise 2 – Taking measurements with CompactDAQ

•  Overview on the graphical interface o  Exercise 3 – Programming structures in LabVIEW o  Exercise 4 – Acquire different signals simultaneously

•  Resources for your application •  Questions and comments

3

National Instruments at a Glance •  Leaders in Computer-Based

Measurement and Automation

•  Long-term Track Record of Growth and Profitability

•  Record Revenue: $1.24B in 2014

•  Fortune “100 Best Companies to Work For” eleven years in a row

•  More than 6000 employees; operations in 40+ countries

•  Founded in 1976 with focus on Instrument Control

•  LabVIEW 1.0 released in 1986

NI HQ

4

Virtual Instrumentation Everywhere More than 30,000 companies annually, including >90% of Fortune 500 manufacturing companies

5

What is LabVIEW? •  LabVIEW is a Programming Language such as C/C++,

Visual Basic, .NET, etc. •  Graphical programming •  For test and measurement and automatization •  Import libraries such as DLL, ActiveX •  Connects to Hardware I/O •  Manage features of O.S. (multicore, etc.)

6

…LabVIEW Is the Standard for Making Measurements

0% 5% 10% 15% 20% 25% 30% 35% 40%

NI LabVIEW Microsoft Visual C/C++

Microsoft Visual Basic Microsoft Visual Basic 6.0

NI - LabWindows™/CVI Microsoft C#

The MathWorks, Inc. - MATLAB® NI Measurement Studio

Agilent VEE NI TestStand

Agilent IO Libraries Suite Python

GeoTest ATEasy Other

Don't use

Software Used for Data Acquisition and Instrument Control

Graphical System Design A platform-based approach for measurement and control

Applications

Deployable Targets

Commercial Technology

Models of Computation, User Interface

Math and Analysis

Measurement and Control I/O

Timing

Graphical System Design A platform-based approach for measurement and control

9

Real-Time FPGA Microprocessor/DSP Desktop Mobile Touch Panel WSN Vision

Different Hardware Access Modules

Hardware

Graphical Systems Design Platform

LabVIEW Everywhere

10

LabVIEWEasilyConnectstoHardwareI/O•  6000+instrumentsfromover250vendors

•  PCI,PCIe,PXI,USB,Ethernet,serial,GPIB,andCANdevices

•  ModulardataacquisiNonhardwarefromDCtotheGHzrange

•  MoNoncontrolstages

•  Cameras

•  HundredsofPLCs

11

TheLabVIEWEnvironment“VI”=programorfuncNon

“FrontPanel”=userinterface “BlockDiagram”=code

12

The LabVIEW Environment Front Panel – User Interface

Block Diagram – Program Logic

13

Controls & Indicators

•  Knobs/Dials •  Graphs/Charts •  Buttons •  Digital Displays •  Sliders •  Thermometers •  Customize and

create your own

14

Functions and Express VIs

Configura7onBasedExpressVI

StandardVIs

15

Dataflow Programming

123

ComparisonwaitsunNlallinputsarepresent,thenexecutesOnceexecuted,outputfromcomparisonconNnuesthroughcode

BothSimulateSignalExpressVIsexecutesimultaneously

1 2 3

16

Συλλογή

Ανάλυση

Παρουσίαση

17

Analyze

Present

Acquire

Ανάλυση

Παρουσίαση

Συλλογή

18

Wires and Data Types

•  Transferdatabetweenblockdiagramobjectsthroughwires

•  Wiresaredifferentcolors,styles,andthicknesses,dependingontheirdatatypes

•  AbrokenwireappearsasadashedblacklinewitharedXinthemiddle

18

Scalar1DArray2DArray

DBLNumeric IntegerNumeric String

19

Exercise 1: Create a simple VI in LabVIEW

What will we learn? –  Working with LabVIEW environment

Create an application that: –  Simulates a signal

–  Calculate the RMS value

–  Show the value in the front panel of LabVIEW

20

Data Acquisition with LabVIEW

21

PC-Based Data Acquisition (DAQ)

22

Measuring Analog Input Signals

• Architecture

§ multiplexed §  simultaneous sampling

• Sampling rate

• Resolution

• Signal conditioning

Analog Input

To PC

Important Factors to Consider

23

Analog Input – Architectures

Channel 0

Channel 1 ADC

Channel 0

Channel 1

Simultaneous sampling

MUX

Multiplexed

AMP

ADC

Channel 0

Channel 1

ADC Channel 0

Channel 1

AMP

AMP

Interchannel delay

No interchannel delay

24

NI DAQ Platforms

PCI/PCIe PXI/PXIe

OneapplicaNon,mulNpletargets

USB

CompactDAQ

Wireless

25

Hi-SpeedUSB2.0

Supportmorethan100modules

Hot-swappable modules

SignalConnecNvity

IntegratedSignalCondiNoning

NI DAQ Platforms

26

Data Acquisition with LabVIEW

•  Triggering •  Sample rates •  Clocking

NI-DAQmx driver software provides connectivity between LabVIEW and your hardware

Programmatic Interface

NI-DAQmx driver configures •  Buffering •  Signal routing •  etc…

Configuration Based

27

Exercise 2: Introduction to data acquisition with LabVIEW

What will we learn §  Take measurements using LabVIEW

and NI CompactDAQ

Create an application that : §  Takes measurements from a

thermocouple and store measurements into a file

28

Measurement and Automation Explorer (MAX)

Device configuration and connection management

Built-in test panel windows

DAQmx Task creation

Signal connection diagrams

29

NI Getting Started

Getting Started with NI Products - National Instruments http://www.ni.com/gettingstarted/

30

Controlling Program Execution

•  Looping (For and While) •  Case structure •  Sequence structure •  State machines •  Event structure •  State diagram editor •  Timed loop

Is Limit Met?

Turn On Output

Yes

Reset Output

No

Start

31

LabVIEW Looping Basics

While Loop For Loop

Run until stop condition met Run N times

32

Exercise 3: Execution of a program

What will we learn –  How to create an application in

LabVIEW

Create an application that: –  Reads temperature from

Thermocouple/RTD

–  Turn on/off digital lines

33

Parallel Operations with LabVIEW LabVIEW C*

(does not include code to generate UI)

LabVIEW C

34

Parallel Operations in LabVIEW Configuring and visualizing multiple tasks graphically is easier

Analog Output Loop

Analog Input Loop

Parallel loops automatically take advantage of multithreading and multi-core processors for higher performance

35

Exercise 4: Multiple operations on analog input channels

What will we learn §  Create parallel operations with LabVIEW

Create an application based on multiple tasks §  Acquire Temperature Measurements

§  Acquire Acceleration Measurements

36

Modules and Toolkits in LabVIEW

37

Real-Time FPGA Microprocessor/DSP Desktop

Dataflow Text-based

Programming/OOP Text-based

Mathematics Simulation Statechart

Mobile Touchpanel WSN Vision

Modules

Hardware

Toolkit

38

PID & Fuzzy Logic Toolkit PID Control

•  Autotuning •  Gain scheduling

Fuzzy Logic •  Control strategies •  Decision making

39

Report Generation Toolkit for Microsoft Office

•  Programmatically create and edit reports in Microsoft Word and Excel

•  Populate report templates •  Manage report layout, format, and

appearance •  E-mail reports and run macros •  Express VI included

40

Database Connectivity Toolkit

•  Insert, select data from OLE DB, ODBC databases §  Microsoft Access, SQL Server, Oracle, etc.

•  Create, drop tables •  Save records in XML format •  Execute SQL queries

§  Immediate, parameterized •  Execute stored procedures •  Accept, reject multiple operations (transactions)

41

LabVIEW Real-Time Module

•  Rapidly develop deterministic applications with graphical programming

•  Easily architect distributed control and monitoring systems

•  Eliminate time spent integrating diverse I/O

42

LabVIEW FPGA Module

•  Define custom FPGA I/O without VHDL programming •  Achieve hardware deterministic response within 25ns •  Execute tasks with true parallelism

NI CompactRIO R Series Intelligent DAQ

43

•  Build LabVIEW-based web thin clients

•  Monitor or

control from your smartphone

•  Connect to

LabVIEW web services

LabVIEW Web UI Builder

44

NI Vision Development Module •  LabVIEW programming libraries for

machine vision and image processing •  Includes Vision Assistant

§  Prototypes and benchmarks applications §  Generates complete code for LabVIEW,

Visual Basic, and C •  Hundreds of tools to:

§  Enhance images §  Check for presence §  Locate features §  Identify parts §  Measure objects

45

Motion Control with LabVIEW •  NI Motion Assistant

§  Interactive environment with 3D visualization §  Ready-to-run LabVIEW or C code creation §  Easy trapezoidal or S-curve velocity profile implementation §  Teach pendant for easy prototyping

•  NI SoftMotion Controller for CANopen and IEEE 1394 §  Use LabVIEW and NI Motion Assistant to program

distributed motion control applications §  Compatible with intelligent CANopen drives from Copley

and IEEE 1394 drives from ORMEC

•  NI SoftMotion Development Module §  Develop custom motion controllers in LabVIEW Real-Time

or LabVIEW FPGA §  Use trajectory generation, spline interpolation, position,

velocity control, and encoder implementation VIs

46

NI SDR Hardware Software Application Frameworks

47

Resources

48

NI LabVIEW – Useful Links

What is LabVIEW: www.ni.com/labview Download LabVIEW: http://www.ni.com/labviewse/

49

WorldwideLabVIEWUserCommunity• Over50,000membersonaward-winningNIDiscussionForums

• NIandLabVIEWuser-contributedblogs

• Morethan100LabVIEWUserGroups

• Third-partycommunitywebsitesinover15languages

• Hundredsofthird-partyadd-ontoolsontheLabVIEWToolsNetwork

ni.com/labview/community

50

Training

Objectives: –  Accelerate learning –  Decrease development time and application mainteinance –  Reliable, escalable and mainteinable applications –  Validate skills and standarize developement procedure

Thank you for your attention!

Questions?