A quick guide to National Instruments USB-6008
Figure 1: The USB-6008
1 Introduction 1 IntroductionThe NI USB-6008 is a data acquisition and control device with the following features:
Figure 3 below shows the analog I/O terminals with labels assuming differential signal coupling.
Figure 3: The analog I/O terminals with labels assuming differential signal coupling Figure 4 below shows the digital I/O terminals with connections for the individual lines. P0 is port 0, and P1 is port 1. For example, P0.3 is line 3 in port 0.
Figure 4: The digital I/O terminals 2 Checking if the USB-6008 device is recognized by the PCTo see if the USB-6008 device is recognized by the PC launch the NI-DAQ Base List Devices utility via Start / Programs / National Instruments / NI-DAQmx Base. Figure 5 shows the window thereby being opened. (The name VISA_USB6008 was defined by me using the MAX utility, but it is not necessary to define VISA names to use the USB-6008.) Figure 5: The NI-DAQ Base List Devices utility 3 Configuring the USB-6008The USB-6008 can be configured using the NI-DAQmx Base Configuration Utility which is available via Start / Programs / National Instruments / NI-DAQmx Base. See the figure below.
Figure 6: The NI-DAQmx Base Configuration Utility Using NI-DAQmx Base Configuration Utility you define tasks. You use tasks in your LabVIEW application to refer to the I/O operations. A task is a collection of definitions expressing various aspects of the signal input or signal output operation to be executed by the I/O device. A task definition may include the following (here an analog input task is assumed):
The figure above shows the settings of the aitask task. (This task was defined by me.) The task listed above aitask and aotask are predefined tasks. To create a new task, press the Create New Task button, causing the dialog window shown in the figure below to be opened.
Figure 7: The Create New Task dialog window You must define one task for each of the input or output operations, i.e. one task for a particular analog input operation and one task for a particular analog output operation. Once you have completed defining the task(s) you click the Save & Exit button. 4 Testing the USB-6008The USB-6008 can be tested using the LabVIEW file USB-600x Interactive Control.llb which is available via Start / Programs / National Instruments / NI-DAQmx Base, see the figure below.
Figure 8: The USB-600x Interactive Control.llb can be used for testing the device 5 Developing a LabVIEW VIIn the following a concrete example VI with analog output and analog input is described. The VI was used to control this DC motor using analog output and to measure the tachometer voltage using analog input. (In this example, no feedback control system is implemented. Only manual control or open loop control is implemented.) The figures below show the front panel and the block diagram of ao_ai.vi which implements analog input and analog output.
Figure 9: Front panel of ao_ai.vi
Figure 10: Block diagram of ao_ai.vi Comments:
6 Multiple I/OSection 3 shows to configure tasks for single I/O operations, and Section 5 shows how to use such single I/O channels in your LabVIEW program. However, the USB6008 has several input channels and several output channels. Assume as an example that your application requires two analog inputs. You should not create one task for each input (in the NI-DAQmx Base Configuration Utility). Instead, you create one analog input task covering both I/O channels. This is done by simply expanding the array in which the channels are defined, see Figure 11.
Figure 11: Configuring one analog input task for two AI channels in the NI-DAQmx Base Configuration Utility In your LabVIEW program you use the Index Array function to address each of the channels, see Figure 12.
Figure 12: In your LabVIEW program each of the channels are addressed using the Index Array function More free tutorials are available at http://techteach.no. December 8, 2005. Finn Haugen (finn@techteach.no). |