DAQmx(Multi-channels). 2 Data Acquisition and Waveforms TOPICS Plug-in DAQ devices Data Acquisition...

Post on 31-Mar-2015

227 views 1 download

Tags:

transcript

DAQmx 下多點 (Multi-channels)訊號量測

許智超

2

Data Acquisition and Waveforms

TOPICSPlug-in DAQ devicesData Acquisition in LabVIEWAnalog InputData LoggingAnalog OutputCountersDigital I/O

3

大綱

NI-DAQ7.3Task 與 Global ChannelTask 與 Physical ChannelMAX 的設定量測程式結論

4

NI-DAQ7.3

NI-DAQ7.3

TraditionalNI-DAQ

NI-DAQmx NI-Switch

5

Overview and ConfigurationFundamental task of a DAQ system is to measure or generate real-world physical signals

DAQ system consists of:•Transducers•Signal Conditioning•Plug-in DAQ device•Driver•Software

6

Measurement

Software Framework

NI-DAQ contains:•Traditional NI-DAQ•NI-DAQmx

7

DAQ Hardware Configuration

Measurement & Automation Explorer (MAX)

8

Channels and Tasks

Signalsai 0

ai 1

ai 2

Sine Wave 1

Sine Wave 2

Sine Wave 3

Channel names

TasksTiming and Triggering

9

NI-DAQmx versus Traditional NI-DAQ Feature NI-DAQmx Traditional NI-

DAQ

Test Panels

DAQ Assistant with code generation

no

On-line diagnostics

Scaling to voltage and physical units

50 kS/s with single point I/O ž

Measurement multithreading ž

Instant calibration

Automatic selection of optimal gains

Guaranteed lossless data

650 Alliance members

Integration with LabVIEW

Developer Exchange discussion forum

Compatible with Legacy ISA Boards

no

Accuracy

Performance

Productivity

Quality Best

Good FairCompatibility

10

Data Acquisition in LabVIEW

Traditional NI-DAQSpecific VIs for performing:• Analog Input• Analog Output• Digital I/O• Counter operations

NI-DAQmxNext generation driver: • VIs for performing a

task• One set of VIs for all

measurement types

11

NI-DAQmx Data Acquisition

Single set of VIs used to perform analog I/O, digital I/O, and counter operations

DAQ Assistant Express VI• Quickly and easily program the DAQ device• Creates a local task• Most applications can use the DAQ

Assistant Express VI

12

NI-DAQmx Data Acquisition Task Types

Measurement type can be:•Analog Input•Analog Output•Counter Input•Counter Output•Digital I/O

13

Analog Input

Analog Input task is specific to the measurement

14

Analog Input Task Timing and Triggering

Configures the number of samples and sample rate for the task

Configures the start and reference triggers for the task

15

Data Logging It is often necessary to permanently store data that

is acquired from the DAQ device LabVIEW includes the ability to read and write a

LabVIEW Measurement File LabVIEW Measurement File is an ASCII text file

16

Analog Output

Analog Output task is specific to the generation type

17

Analog Output Task Timing and Triggering

Configures the number of samples and sample rate for the task

Configures the start and reference triggers for the task

18

CountersA counter is a digital timing deviceTypical uses of a counter:• Event counting• Frequency measurement• Period measurement• Position measurement• Pulse generation

Gate

Source

Output

Count Register

Count register – Stores the current count of the counterSource – Input that causes the counter to increment each time it togglesGate – Input that is used to enable or disable the function of the counterOutput – Signal that generates pulses or a series of pulses

19

Digital Input and OutputDigital I/O can

read from or write to a line or an entire digital port

A digital port is a collection of digital lines

20

SummaryMAX is the primary configuration and testing utility

that is available for the DAQ device.The DAQ Assistant is used to configure the DAQ

device and perform data acquisition.Most application can use the DAQ Assistant. For

applications that require advanced timing and synchronization use the VIs that come with NI-DAQmx.

The DAQ Assistant can perform Analog Input, Analog Output, Digital I/O, and Counter operations.

21

NI-DAQmx 的優點

DAQ Assistant.Increased performance-faster single point I/

O and multithreading( 多緒 ).Simple and intuitive API.DAQ property nodes and waveform support.Similar API for all programming languages.

Trad. DAQ DAQmx

22

Task 與 Global Channel

一個 task 包含多個 global channel 。當 global channel 的參數改變, task

也會改變。用 task 或多個 global channels 來達成

multi-channel 。

23

Task 與 Physical Channel

Task 要在 MAX 中設定。Physical Channel 的參數在 LabVIEW 中

設定。

PS : Global Channel 也要在 MAX 中設定。

24

MAX 中關於 Global Channel 的設定

25

MAX 中關於 Task 的設定

26

量測程式

Using the task.Using multiple global channels.Using multi-thready with physical channel.Using the “Write LVM” VI.

27

Front PanelBlock Diagram

Single-channel Measurement Program-Using Task

28

Front PanelBlock Diagram

Multi-channel Measurement Program-Using Task

29

Front PanelBlock Diagram

Single-channel Measurement Program-Using global channel

30

Front PanelBlock Diagram

Multi-channel Measurement Program-Using global channel

31

Single-channel Measurement Program-Using Physical Channel

Front PanelBlock Diagram

32

Multi-channel Measurement Program-Using Physical Channel ?!

用多緒執行來達成,但是會增加負擔,不建議使用。

33

結論

Task 是相當方便的架構,但是有彈性不夠的缺點。

使用 Global Channel 是一個較佳的方式,在量測時間的處理上比較活用。

多緒執行不適合用執行這樣的訊號量測程式。

34

結論 -1較理想的加速度規量測程式 for Multi-channels

35

附錄