350 likes | 394 Views
DAQmx 下多點 (Multi-channels) 訊號量測. 許智超. Data Acquisition and Waveforms. TOPICS Plug-in DAQ devices Data Acquisition in LabVIEW Analog Input Data Logging Analog Output Counters Digital I/O. 大綱. NI-DAQ7.3 Task 與 Global Channel Task 與 Physical Channel MAX 的設定 量測程式 結論. NI-DAQ7.3.
E N D
Data Acquisition and Waveforms TOPICS Plug-in DAQ devices Data Acquisition in LabVIEW Analog Input Data Logging Analog Output Counters Digital I/O
大綱 • NI-DAQ7.3 • Task 與 Global Channel • Task 與 Physical Channel • MAX的設定 • 量測程式 • 結論
Overview and Configuration • Fundamental 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
Measurement Software Framework • NI-DAQ contains: • Traditional NI-DAQ • NI-DAQmx
DAQ Hardware Configuration Measurement & Automation Explorer (MAX)
Channels and Tasks Channel names Sine Wave 1 ai 0 Signals Sine Wave 2 ai 1 ai 2 Sine Wave 3 Tasks Timing and Triggering
NI-DAQmx versus Traditional NI-DAQ Productivity Performance Accuracy Quality Compatibility • Best • Good Fair
Data Acquisition in LabVIEW • NI-DAQmx • Next generation driver: • VIs for performing a task • One set of VIs for all measurement types • Traditional NI-DAQ • Specific VIs for performing: • Analog Input • Analog Output • Digital I/O • Counter operations
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
NI-DAQmx Data Acquisition Task Types • Measurement type can be: • Analog Input • Analog Output • Counter Input • Counter Output • Digital I/O
Analog Input Analog Input task is specific to the measurement
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
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
Analog Output Analog Output task is specific to the generation type
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
Counters • A counter is a digital timing device • Typical uses of a counter: • Event counting • Frequency measurement • Period measurement • Position measurement • Pulse generation Gate Output Count Register Source Count register – Stores the current count of the counter Source – Input that causes the counter to increment each time it toggles Gate – Input that is used to enable or disable the function of the counter Output – Signal that generates pulses or a series of pulses
Digital Input and Output • Digital I/O can read from or write to a line or an entire digital port • A digital port is a collection of digital lines
Summary • MAX 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.
Trad. DAQ DAQmx 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.
Task 與Global Channel • 一個 task 包含多個 global channel。 • 當 global channel 的參數改變, task 也會改變。 • 用 task 或多個 global channels 來達成 multi-channel。
Task 與Physical Channel • Task 要在 MAX 中設定。 • Physical Channel 的參數在LabVIEW中設定。 • PS:Global Channel 也要在MAX中設定。
量測程式 • Using the task. • Using multiple global channels. • Using multi-thready with physical channel. • Using the “Write LVM” VI.
Block Diagram Front Panel Single-channel Measurement Program-Using Task
Front Panel Block Diagram Multi-channel Measurement Program-Using Task
Front Panel Block Diagram Single-channel Measurement Program-Using global channel
Front Panel Block Diagram Multi-channel Measurement Program-Using global channel
Front Panel Block Diagram Single-channel Measurement Program-Using Physical Channel
Multi-channel Measurement Program-Using Physical Channel ?! • 用多緒執行來達成,但是會增加負擔,不建議使用。
結論 • Task 是相當方便的架構,但是有彈性不夠的缺點。 • 使用 Global Channel 是一個較佳的方式,在量測時間的處理上比較活用。 • 多緒執行不適合用執行這樣的訊號量測程式。
較理想的加速度規量測程式 for Multi-channels 結論-1