0% found this document useful (0 votes)
6 views

Basic Programing for Electronics-Chap 3_1+2 (2)

This document provides an overview of programming with DAQmx, focusing on data acquisition and generation using the DAQ Assistant. It includes practical examples, specifications for the NI USB 6008, and homework assignments for students to practice coding and report writing. The document emphasizes the importance of understanding data logging and the functionalities of LabVIEW.

Uploaded by

daominhhieu1109
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Basic Programing for Electronics-Chap 3_1+2 (2)

This document provides an overview of programming with DAQmx, focusing on data acquisition and generation using the DAQ Assistant. It includes practical examples, specifications for the NI USB 6008, and homework assignments for students to practice coding and report writing. The document emphasizes the importance of understanding data logging and the functionalities of LabVIEW.

Uploaded by

daominhhieu1109
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Faculty of Electrical and Electronic Engineering

Basic Programming for


Electronics
Dr. Chien Viet Nguyen Email: [email protected]

phenikaa-uni.edu.vn
Chapter 3 : Programming with DAQmx

Contents:
1. Data acquisition via DAQ
2. Data generation via DAQ
3. Practice
4. Summary

phenikaa-uni.edu.vn
Outline

Sensor DAQ Algorithm DAQ Output

Display

Load data
Save data

PC

3
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Hardware Management:
Measurement & Automation
Explorer (NI Max)

4
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Virtual DAQ:
Virtual Instrument

5
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Check Specifications
Test Panels

Right-click

6
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
NI USB 6008

7
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Groups Important specifications Values

# channels 4 differential NI USB 6008


channels
8 single channels
Resolution 12 bits -> differential
11 bits -> single
Analog Inputs
Max Sampling rate 10kS/s
(Aggregate)
Input voltage range ±1, ±1.25, ±2, ±2.5,
-> voltage resolution ±4, ±5, ±10, ±20 V.
# channels 2 channels
Analog output Max update rate 150Hz
Output voltage range 0~5V
Digital I/O # lines P0 [0 7]: 8 lines
P1 [0 3]: 4 lines
8
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Example: DAQ Assistant NIDAQ1800 -> Extraction -> Setup
Block diagram -> Right-click
-> Measurement I/O
-> NI DAQmx -> DAQ Assist

9
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Example: DAQ Assistant
Double click on DAQ Assistant VI
-> Test panel Setting params -> OK

10
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Example: DAQ Assistant

11
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Example: DAQ Advance

Can custom param


setting on software
interface:
• Channels
• Timing
• Logging
• Trigger

12
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Example: DAQ Advance

13
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Example: Logging from DAQ Assistant to .csv file
(Practice) – Students come to code

14
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Previous problem: manual create a file or must select file before running
Wants: Type a file name -> Record data -> How to do ???

Right-click on “file path” -> choose folders

15
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Wants: Type a file name -> Record data -> How to do ???

Right-click on Front panel


-> String & Path
-> String control

16
phenikaa-uni.edu.vn
3.1 Data acquisition using DAQ Assistant
Wants: Type a file name -> Record data -> How to do ???
Build a file path with a file name

Set file path, then only enter file name


17
phenikaa-uni.edu.vn
Summary
• Check homework: student practice
• DAQ assistant via NI Max
• DAQ advance
• Logging data from DAQ assistant to a file
• Code practice

Homework:
• Program DAQ assistant
• Save data from DAQ assistant

18
phenikaa-uni.edu.vn
Analog output
3.2 Data Generation using DAQmx
Voltage generator

19
phenikaa-uni.edu.vn
Analog output
3.2 Data Generation using DAQmx
Voltage generator

20
phenikaa-uni.edu.vn
Analog output
3.2 Data Generation using DAQmx
Example: Voltage generation -> Voltage acquisition
AO -> AI

AO 0 -> AI 0
NI myDAQ device
Wire connection
21
phenikaa-uni.edu.vn
Analog output
3.2 Data Generation using DAQmx
Example: Voltage generation -> Voltage acquisition
Play demo

Analog
acquisition

Analog
output

22
phenikaa-uni.edu.vn
Summary
• Check homework: student practice
• Case structure
• Shift register
• Signal generator
• Practical coding

Homework -> Will be evaluated by marks for midterm


• Homework in slide 14
• Write a report about the functions and applications of LabVIEW
• Produce an code example that you like, and explain it in the report
• All done by English
• Do not copy of another student! If not, will get zero point
23
phenikaa-uni.edu.vn
Thanks for your attention!
Q&A

phenikaa-uni.edu.vn

You might also like