Top Banner
uk.ni.com ireland.ni. com DAQmx Alistair Bailey – Field Engineer
24

DAQmx

Feb 17, 2016

Download

Documents

zubin

DAQmx. Alistair Bailey – Field Engineer. What is DAQmx?. At it’s core , DAQmx is a powerful hardware driver for controlling data acquisition hardware. DAQmx Core Concepts. Global Virtual Channel Contains the physical channel and other channel-specific information Task - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DAQmx

uk.ni.comireland.ni.co

m

DAQmx

Alistair Bailey – Field Engineer

Page 2: DAQmx

2uk.ni.com

ireland.ni.com

What is DAQmx?At it’s core, DAQmx is a powerful hardware driver for controlling data acquisition hardware.

Hundreds of DAQ Devices

DAQ Hardware

USB, PXI Express, PCI ExpressBus

NI-DAQmxHardware Driver

LabVIEW, C, .NETApplication Software

Page 3: DAQmx

3uk.ni.com

ireland.ni.com

DAQmx Core ConceptsGlobal Virtual Channel

Contains the physical channel and other channel-specific informationTask

A collection of one or more channelsFunctions

Performs a specific function in DAQmxProperties

Control or set specific properties of your DAQmx session

Page 4: DAQmx

4uk.ni.com

ireland.ni.com

1. DAQ Assistant• The DAQ Assistant is a

configuration-based interface for controlling your DAQ instruments

• You can configure things like:

• Channels• Voltage ranges• Sampling rate• …and many other aspects

of your measurement

Page 5: DAQmx

6uk.ni.com

ireland.ni.com

2. Create Virtual ChannelCreates a virtual channel and adds it to a DAQmx task. If a task doesn’t exist, it creates one.

Page 6: DAQmx

7uk.ni.com

ireland.ni.com

2. Create Virtual ChannelCreates a virtual channel and adds it to a DAQmx task. If a task doesn’t exist, it creates one.

Channel Expansion across modules in a PXI chassis

Page 7: DAQmx

8uk.ni.com

ireland.ni.com

3. TriggerConfigures a trigger to perform a specific action. The most common actions are a start trigger and reference trigger.

Page 8: DAQmx

9uk.ni.com

ireland.ni.com

4. TimingConfigures the timing for hardware-timed data acquisition.

Page 9: DAQmx

10

uk.ni.comireland.ni.co

m

4. TimingConfigures the timing for hardware-timed data acquisition.

The DAQmx Task BufferTemporary storage in computer memory for acquired or to-be-

generated samples

Page 10: DAQmx

11

uk.ni.comireland.ni.co

m

5. Start TaskStarts your task. The task is now in the running state.

Page 11: DAQmx

12

uk.ni.comireland.ni.co

m

DAQmx Task State Model

Unverified Verified Reserved Committ

ed Running

AbortAbort

Abort

Create Verify Reserve Commit Start

Unreserve StopSetClear

Page 12: DAQmx

13

uk.ni.comireland.ni.co

m

6. ReadReads samples from the acquisition task.

The Read function adapts to different data types and channel counts

Start your task and read data

Page 13: DAQmx

14

uk.ni.comireland.ni.co

m

7. WriteWrites samples to the generation task.

The Write function adapts to different data types and channel counts

Write data, then start your task

Page 14: DAQmx

15

uk.ni.comireland.ni.co

m

8. Wait Until DoneWaits for the data acquisition operation to complete before finishing.

Page 15: DAQmx

16

uk.ni.comireland.ni.co

m

9. Clear TaskClears the task, and releases all of the resources. If the task needs to be reused, use Stop Task instead.

After the DAQmx read, clear the task.

Page 16: DAQmx

17

uk.ni.comireland.ni.co

m

10. PropertiesAccess all of the properties associated with DAQmx. Properties can by written to or read.

DAQmx TimingQuery the actual sample rate

DAQmx ChannelSpecify which terminal pules

Page 17: DAQmx

18

uk.ni.comireland.ni.co

m

Why Use the API?Advanced control over your measurement

system

Multiple Language Support

Task and State Management

Multi-device Synchronization

Advanced Application Architectures

Ability to provide even better performance

Page 18: DAQmx

20

uk.ni.comireland.ni.co

m

Example 1 – Multi Channel Analog OutputTwo ChannelsDifferent Frequencies

Fundamentals:•The sample rate is the “update rate” of the DACThe only variable we can play with is the number of samples in our waveform.•Use “interpolation” and “decimation” to modify the frequency of one independently.

Page 19: DAQmx

21

uk.ni.comireland.ni.co

m

Output Waveform FrequencyOutput waveform frequency depends on three factors:

• Update rate• Points in the buffer• Number of cycles

in the buffer

Signal Frequency = update rate

points in the buffer# of cycles in buffer X

Page 20: DAQmx

22

uk.ni.comireland.ni.co

m

Output Waveform Frequency• Buffer size = 1000 pts• # of cycles in buffer = 1• Update rate = 1000 Hz

• Buffer size = 1000 pts• # of cycles in buffer = 1• Update rate = 2000 Hz

• Buffer size = 1000 pts• # of cycles in buffer = 2• Update rate = 1000 Hz

Signal frequency = 1 Hz

Signal frequency = 2 Hz

Signal frequency = 2 Hz

Signal Frequency = update ratepoints in the buffer

# of cycles in buffer X

Page 21: DAQmx

23

uk.ni.comireland.ni.co

m

Demo

Page 22: DAQmx

24

uk.ni.comireland.ni.co

m

Example 2 – Simultaneous AI & AOOptions:1. Independent of each other

1. All hardware with hardware timed AO2. cDAQ with STC-3

2. Start together1. Use the same hardware trigger for AI & AO on the

trigger VI3. Same clock (preserves phase relationship)

1. Use the same sample clock on the timing VI

Page 23: DAQmx

25

uk.ni.comireland.ni.co

m

Demo

Page 24: DAQmx

uk.ni.comireland.ni.co

m

Questions?