• No results found

NI myDAQ

N/A
N/A
Protected

Academic year: 2021

Share "NI myDAQ"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)

Telemark University College

Department of Electrical Engineering, Information Technology and Cybernetics

Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01

NI myDAQ

(2)

ii

Table of Contents

Table of Contents ...ii

1 Introduction to myDAQ ... 1

2 System Description ... 3

3 Installation and Configuration ... 4

4 Using myDAQ as a Multimeter ... 5

5 Using myDAQ as a Scope ... 7

6 Using myDAQ as a Function Generator ... 8

7 Using myDAQ in LabVIEW ... 9

7.1 NI-DAQmx ... 9

7.1.1 DAQ Assistant ... 9

7.1.2 Using DAQmx functions ... 16

(3)

1

1 Introduction to myDAQ

NI myDAQ is a simple and intuitive DAQ device from National Instruments. NI myDAQ have Analog Inputs (AI), Analog Outputs (AO), Digital Inputs (DI) and Digital Outputs (DO).

In addition to traditional I/O, the myDAQ have a built-in Digital Multimeter. The myDAQ can also be used as a Power Supply. Using the built-in software the myDAQ can also be used as an Oscilloscope and Function Generator.

When you plug in the device in the USB connection on your PC, the following will pop-up automatically (NI ELVISmx Instrument Launcher):

Note! You need to install the NI ELVISmx driver software first

(4)

2 Introduction to myDAQ

Lab Equipment: NI myDAQ

If you click on the DMM button, the built-in Digital Multimeter will appear:

If you want to use the myDAQ inside LabVIEW for Data Acquisition, you either use the traditional NI-DAQmx features or you may use NI-ELVISmx features. Both will be shown in this Tutorial.

(5)

3

2 System Description

Below we see an overview of the NI myDAQ device:

Specifications:

 Two Differential Analog Input and Analog Output Channels (200 ks/s, 16 bit, +/- 10 Volts)  Eight Digital Input and Digital Output Lines (3.3 Volt TTL-Compatible)

 +5 , +15, and -15 Volt Power Supply Outputs (up to 500m Watts of Power)  60 Volt Digital Multimeter (DMM) for Measuring Voltage, Current, and Resistance The following are included in the package:

(6)

4

3 Installation and

Configuration

You need to install the NI-ELVISmx software that comes with the device. The NI-ELVISmx software installs the DAQmx driver software as well as the Measurement and Automation Explorer.

You use MAX (Measurement and Automation Explorer) for configuration.

(7)

5

4 Using myDAQ as a

Multimeter

When you plug in the device in the USB connection on your PC, the following will pop-up automatically (NI ELVISmx Instrument Launcher):

(8)

6 Using myDAQ as a Multimeter

Lab Equipment: NI myDAQ

(9)

7

5 Using myDAQ as a Scope

When you plug in the device in the USB connection on your PC, the following will pop-up

automatically (NI ELVISmx Instrument Launcher):

(10)

8

6 Using myDAQ as a

Function Generator

When you plug in the device in the USB connection on your PC, the following will pop-up automatically (NI ELVISmx Instrument Launcher):

(11)

9

7 Using myDAQ in LabVIEW

If you want to use the myDAQ inside LabVIEW for Data Acquisition, you either use the traditional NI-DAQmx features or you may use NI-ELVISmx features. Both will be explained in detail below.

7.1 NI-DAQmx

In order to use the myDAQ device in LabVIEW you need to use the DAQmx functions. Below we see the DAQmx palette in LabVIEW (Measurement I/O → NI-DAQmx)

7.1.1

DAQ Assistant

We will create a very simple example with 2 VIs, one VI for writing (Analog Out) and one for reading (Analog In).

Analog Out:

In this simple example we will use AO0 (Analog Out, Channel 0).

(12)

10 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

When dragging this VI to the Block Diagram, the following Wizard appears:

We shall write data, so we need to select “Generate Signals”.

(13)

11 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

Next we select AO0:

Finally we set properties for Min and Max values, Timing Settings, etc.:

(14)

12 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

Next, we need to finish our LabVIEW application as follows:

In addition to the DAQ Assistant we a While Loop, a “Wait (ms)” function. On the Front Panel we need Numeric Control and a Stop Button:

Analog In:

In this simple example we will use AI0 (Analog In, Channel 0).

(15)

13 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

When dragging this VI to the Block Diagram, the following Wizard appears:

We shall read data, so we need to select “Acquire Signals”.

(16)

14 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

Next we select AI0:

Finally we set properties for Min and Max values, Timing Settings, etc.:

(17)

15 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

Next, we need to finish our LabVIEW application as follows:

In addition to the DAQ Assistant we a While Loop, a “Wait (ms)” function. On the Front Panel we need Numeric Indicator and a Stop Button:

In order to test the applications, we can wire AO0 and AI0 together (a so-called Loopback text). If we write 3V in the “Write Analog Out.vi”, we should be able to read 3V in the “Read Analog In.vi”.

(18)

16 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

7.1.2

Using DAQmx functions

Another approach is to put the DAQ Assistant outside the loop for better performance. Analog Out:

In this example we have used the DAQmx functions “DAQmx Start Task.vi”, “DAQmx Write.vi” and “DAQ Clear Task.vi” from the DAQmx palette.

Analog In:

In this example we have used the DAQmx functions “DAQmx Start Task.vi”, “DAQmx Read.vi” and “DAQ Clear Task.vi” from the DAQmx palette.

The applications will work exactly the same as in the previous example, but the performance will be slightly better, especially for larger applications.

(19)

17 Using myDAQ in LabVIEW

Lab Equipment: NI myDAQ

7.2 NI-ELVISmx

Below we see the NI ELVISmx palette in LabVIEW (Measurement I/O → NI ELVISmx)

The NI ELVISmx palette consists of different Express Vis. Digital Multimeter:

Oscilloscope:

(20)

Telemark University College Faculty of Technology Kjølnes Ring 56 N-3918 Porsgrunn, Norway www.hit.no Hans-Petter Halvorsen, M.Sc. Telemark University College

Faculty of Technology

Department of Electrical Engineering, Information Technology and Cybernetics

E-mail: [email protected]

References

Related documents

The findings of the third study suggest that firms that contribute to government’s policy of fostering employment are less likely to be subject to SEC’s enforcement actions.

The primary treatment of localized prostate cancer can include radical prostatectomy (open, laparoscopic, or robotic) or radiotherapy (brachytherapy or intensity

According to Öhrling (2000) student nurses need more time for reflection. The negative experiences were expressed as a feeling of wooliness related to making the painting and

algorithmically providing orientation landmarks within information structures (Fairchild, Poltrock, & Furnas, 1988; Godin, Gecsei, & Pichet, 1989) that has been

With the spreadsheet model introduced, the workshop participants developed four consistent scenarios of Morocco’s power supply. The scenarios corresponded to the

Figure 4 indicates that China and India are very close to the US in terms of expense ratio; both markets fall quite behind in insurance penetration; India has a lower loss ratio

od majke, od matenice, od sigurnosti, koje je povrh svega izrazito bolno kako za maj- ku tako i za dijete. To možemo vidjeti kao primaru transformaciju u fizičkom postoja- nju, dok

Despite its inability to sort, the parallel counter described earlier may be used in the design of a network which sorts n numbers in time proportional to log