Академический Документы
Профессиональный Документы
Культура Документы
1) Digital Oscilloscope
2) Function Generator
3) Digital DMM
4) Power Supply
5) Analog/Digital Input/Output
6) Logic Analyzer
7) Image Acquisition
8) Servo-motor Testing
Each of these functions can be controlled either through a software application specific to
the function, or through LabVIEW. The power of having these functions controlled
through LabVIEW is that you can generate signals, output them to your circuitry, then
collect and analyze the data that is gathered.
The remainder of this document deals with how to use the specific software applications
specific to each function and how to use the functions with LabVIEW. There are also a
few programs that will be useful for a number of functions that will be discussed after all
of the functions have been dealt with.
Figure 1
-1-
National Instruments Workstation Help Manual
This is a more compact form of what you
would find on a traditional oscilloscope. It
has all the same functionalities, but in an
easier to use package. You have two
channels to use, as well as a trigger. The
graphical display is located in the upper left
section of the window and the controls are
located around it. Along the right side of
the window are the controls for the
horizontal and vertical divisions for the
graphical display as well as the selection of
the channel. Along the bottom are the
controls for the trigger. Measurements can Figure 2
be added by going to the Window menu and clicking on Measurements. You can also
print the window being displayed by going to the File menu and going to Print Window.
To control the oscilloscope using LabVIEW, you will need to use the NI-Scope Express
VI. This is located under the inputs menu of the functions palette. The screen you will
need to find is located below in figure 3. This might seem counter-intuitive, since you
usually connect the oscilloscope to the output of your circuit, but since LabVIEW is
reading in the data through the oscilloscope, it is considered an input. You can modify
most, if not all, of the properties available in the GUI, but using LabVIEW allows you the
added benefit of recording data and performing signal processing on the output of your
circuit. The actual VI is also pictured below in figure 4.
-2-
National Instruments Workstation Help Manual
-3-
National Instruments Workstation Help Manual
To use the NI-FGEN Express VI is a little tricky. First of all, you
need to have two placed on the block diagram for it to function
correctly. In the one, you will need to check the box marked “Start
generation.” You can then change the settings for the function
generator. You will then need to place a second NI-FGEN Express
VI on the block diagram and in this one, check the box that says
“Stop generation.” If this is not placed on the block diagram, the Figure 7
function generator will not stop generating and you may end up hurting your circuit or
yourself. These two blocks should also not be placed inside the loop for your main
program. You don’t want to have the function generator initialized every iteration of the
loop, simply to start generating when you start the program and stop generating when you
end the program. To do this, use the Case Structure Express VI from the Execution
Control menu and place the NI-FGEN Express VI with the “Stop Generation” box
checked inside the Structure for the true condition. If you then wire the stop button to the
input of the Case Structure Express VI, whenever the stop button is pressed, the function
generator will turn off. Below is an example of what your setup should look like (Figure
8).
Figure 8
-4-
National Instruments Workstation Help Manual
This DMM is equipped with
many of the traditional
functions available on a
standard DMM, such as AC
and DC currents and voltages,
resistance, and diode tests.
However, this DMM also has
the ability to measure
frequency, capacitance and
inductance. It also allows the
user to quickly change the
range and resolution using the
drop down menus as well as allowing for Figure 9
scaling and some basic calculations. Having all this power at the click of a mouse
definitely makes this much more user friendly then a traditional hand unit.
-5-
National Instruments Workstation Help Manual
14 +5 V +5 V 48 P0.7 P0.7
15 D GND D GND 49 P0.2 P0.2
16 P0.6 P0.6 50 D GND D GND
17 P0.1 P0.1 51 P0.5 P0.5
18 D GND D GND 52 P0.0 P0.0
19 P0.4 P0.4 53 D GND D GND
20 AO Ext Ref APFI 0 54 AO GND AO GND
21 AO 1 AO 1 55 AO GND AO GND
22 AO 0 AO 0 56 AI GND AI GND
23 AI 15 AI 15 57 AI 7 AI 7
24 AI GND AI GND 58 AI 14 AI 14
25 AI 6 AI 6 59 AI GND AI GND
26 AI 13 AI 13 60 AI 5 AI 5
27 AI GND AI GND 61 AI 12 AI 12
28 AI 4 AI 4 62 AI SENSE AI SENSE
29 AI GND AI GND 63 AI 11 AI 11
30 AI 3 AI 3 64 AI GND AI GND
31 AI 10 AI 10 65 AI 2 AI 2
32 AI GND AI GND 66 AI 9 AI 9
33 AI 1 AI 1 67 AI GND AI GND
34 AI 8 AI 8 68 AI 0 AI 0
Signal
Ref Direction Description
Name
AI Ground—These pins are the reference point for single-
ended AI measurements in RSE mode and the bias current
AI GND — — return point for DIFF measurements. All three ground
references—AI GND, AO GND, and D GND—are
connected on the device.
AI Channels 0 through 15—You can configure each
AI
AI <0..15> Input channel pair, AI <i, i+8> (i = 0..7), as either one differential
GND
input or two single-ended inputs.
AI Channels 16 through 63 (NI PCI-
AI AI 6031E/6033E/6071E only)—Each channel pair, AI <i , i
Input
<16..63> GND +8> (i = 16..23, 32..39, 48..55), can be configured as either
one differential input or two single-ended inputs.
AI Sense—This pin is the reference node for AI <0..15> in
AI SENSE — Input
NRSE mode.
AI SENSE — Input AI Sense 2—This pin is the reference node for AI <16..63>
-6-
National Instruments Workstation Help Manual
2 in NRSE mode.
AO Analog Channel 0 Output—This pin supplies the voltage
AO 0 Output
GND output of AO channel 0.
AO Analog Channel 1 Output—This pin supplies the voltage
AO 1 Output
GND output of AO channel 1.
AO Ground—The AO voltages are referenced to these
AO GND — — pins. All three ground references—AI GND, AO GND, and
D GND—are connected on the device.
Digital Ground—These pins supply the reference for the
digital signals at the I/O connector as well as the +5 VDC
D GND — —
supply. All three ground references—AI GND, AO GND,
and D GND—are connected on the device.
Digital I/O Signals—You can individually configure each
D Input or
P0.<0..7> signal as an input or output. P0.6 and 7 can also control the
GND Output
up/down signal of Counters 0 and 1, respectively.
AO EXT AO External Reference—This is the external reference input
Input
REF GND for the AO circuitry.
NI 6025E only—Port 1 bidirectional digital data lines for
D Input or the 82C55A programmable peripheral interface. P1.7 is the
P1.<0..7>
GND Output most significant bit (MSB). P1.0 is the least significant bit
(LSB).
NI 6025E only—Port 2 bidirectional digital data lines for
D Input or
P2.<0..7> the 82C55A programmable peripheral interface. P2.7 is the
GND Output
MSB. P2.0 is the LSB.
NI 6025E only—Port 3 bidirectional digital data lines for
D Input or
P3.<0..7> the 82C55A programmable peripheral interface. P3.7 is the
GND Output
MSB. P3.0 is the LSB.
D
+5 V Output +5 V Power Source—These pins provide +5 V power.
GND
AI Hold Complete Event Signal—When enabled, this
signal pulses once for each A/D conversion in sampling
AI HOLD D
Output mode. The low-to-high edge indicates when the input
COMP GND
signal can be removed from the input or switched to
another signal.
External Strobe Signal—You can toggle this output with
software controls to latch signals or trigger events on
external devices. This functionality is not available in
EXT D
Output LabVIEW or NI-DAQ. EXT STROBE is used for
STROBE GND
controlling SCXI chassis, and it is not a general-purpose
signal. If you want to use or control this signal, you must
perform register-level programming.
PFI 0/AI D PFI 0—As an input, this pin is a programmable function
Input
START GND interface (PFI).
-7-
National Instruments Workstation Help Manual
-8-
National Instruments Workstation Help Manual
*This table was taken from E Series Help, July 2004 Edition, part number 370503D-01
published by National Instruments Corporation.
The LabVIEW controls for this hardware device are pretty hard to get to. From the
Block Diagram, go to the All Functions button, then NI Measurements button, and finally
the NI-HSDIO button. Located at the bottom of the window will be the NI-HSDIO
Acquire and Generate Express VI’s. The Acquire VI will read in digital data while the
Generate will output digital data.
-9-
National Instruments Workstation Help Manual
Functions NI-HSDIO
NI Measurements
All Functions
To display the data read in from the Acquire VI, you will need to use a Digital Waveform
Graph, which is also somewhat hard to locate. To find this, from the Front Panel, go to
the All Controls button, then the Graph button. You should find the Digital Waveform
Graph there.
Controls
Graph
All Controls
- 10 -
National Instruments Workstation Help Manual
- 11 -
National Instruments Workstation Help Manual
29 DIO 3 63 DIO 2
30 PFI 3 64 PFI 2
31 DIO 1 65 DIO 0
32 D GND 66 D GND
33 DDC CLK OUT 67 STROBE
34 D GND 68 D GND
All Functions
The VI’s that will be most useful will be the “read from digital line,” “read from digital
port,” “write to digital line,” and “write to digital port” VI’s. These four VI’s will give
you all the functionality you should need to write data out to the lines or read data in.
More complex functionality is available through the Advanced Digital I/O menu located
at the bottom right of the Digital I/O screen.
For help on how to set up programs to read and write to this card, in LabVIEW go to
Help->Find Examples. This should bring up a new window (figure 10). Double click on
“Hardware Input and Output,” followed by “Traditional DAQ,” “Digital Input and
Output,” and “653x.” There should then be a number of different already constructed
VI’s that you can open and use, or simply find inspiration from.
- 12 -
National Instruments Workstation Help Manual
Figure 10
There are two ways to access this functionality. The first way is to use LabVIEW. This
is not always the easiest thing to do, especially if you’re not very experienced with
LabVIEW programming. If you want to try to control the Image Acquisition card
through LabVIEW, follow the steps below to locate the Vision VI’s.
- 13 -
National Instruments Workstation Help Manual
Functions NI-Vision
NI Measurements
All Functions
The second, and much easier, way to control this card is through a piece of software
called Vision Assistant. To access this program, go to “start\programs\National
Instruments\Vision Assistant 7.1\Vision Assistant 7.1” or click on the shortcut in the
quick launch toolbar. The following screen will appear (figure 11).
Figure 11
From this screen, you can either open a previously acquired image, acquire a new one if
there is a camera hooked up to the PXI-1409 card, or search through the “Solution
Wizard” to see if there is already a program written to accomplish your task. Which ever
option you choose, you will be taken through the steps to open an image, acquire an
image, or look through the already created solutions. Once you’ve finished that process
you will reach the following screen (figure 12).
- 14 -
National Instruments Workstation Help Manual
Figure 12
This is the main window for the program. As you can see, the window is broken up into
four sections. The large section in the upper right shows the image that you’re working
on and the results of any processing steps you add. Below it is the script window. This is
where the steps that you add will appear. The order that you place the steps in this
window is the order that they will be executed if you run the script. The lower left
section is the Processing Function window, which lists all the functions available. These
functions are also available in the drop down menus over top of the first section. Finally,
the window at the upper left is the image browser. You can store images that you’ve
created here or open/acquire multiple images and use this area to select which images to
work on. There is also a second tab at the top which accesses a help menu.
To add steps to the script, simply select the function you want to use on the image, either
from the Processing Function window or the drop down menus. A screen specific to that
function will then appear, which allows you to change certain properties of the function.
Once you’ve finished modifying the properties, click ok and the step is added to the script
window and the image is updated with the resulting image.
Once you’ve finished creating your script, you can save the final image by going to “Save
Image As…” and you can save the script by going to “Save Script As…,” both of which
are located under the file menu. You can also export this script to as either a LabVIEW
program or C-code. To do this, select either “Create LabVIEW VI” or “Create C Code”
under the “Tools” menu.
- 15 -
National Instruments Workstation Help Manual
As with some of the other functions, there are several ways to interact with this device.
As with all of the functions, this device can be accessed through LabVIEW using the
motion functions available. However, this is a very complicated task. The diagram
below shows how to access the motion VI’s in LabVIEW.
Functions Palette
NI Measurements
All Functions
The other way to access this function is to use the Motion Assistant. This is a program
that uses a GUI to help generate motion scripts. To open this program, either go to
“start\programs\National Instruments\Motion Assistant\Motion Assistant” or click on the
shortcut in the quick launch toolbar. This will bring up the following screen (figure 13).
Figure 13
- 16 -
National Instruments Workstation Help Manual
From this start up screen, you can go through a number of tutorials and help content that
will make using the Motion Assistant much easier. If you do not want to look through
any of the help content, simply start adding steps to your motion script. Do this by
clicking on the “Add Step” button located at the left side of the main window in the script
window. For almost all applications, you will want your first step to be a reference
move. Once you’ve added a step, the window should now look like this (figure 14).
Figure 14
This window has four main parts. On the far right is the help window. You can either
show or hide this help window by clicking the button right above it. In the middle of the
screen are the graph window on the top and the “Step Setup” window at the bottom.
Finally, to the far left is the script window, which shows the order of the motion steps
that have been added.
The graph window shows you the speed and acceleration curves of the move, the 2-D
path that will be taken, and the 3-D path that will be taken. Since the equipment
available can only handle two axes, the 3-D path will not be very useful.
The “Step Setup” window has three tabs that allow you to modify many of the properties
for the current step. You can access more properties by going to “Properties” under the
“Edit” menu. You can also view the current state of the step by going to the “Step
Status” tab located next to the “Step Setup” tab at the very bottom of the screen (figure
15).
- 17 -
National Instruments Workstation Help Manual
Figure 15
Once you have finished your script, you can run it using this program as well. To run
your script, click the “Run” button . Assuming everything is connected properly,
this will start your script running. If you need to stop your script at any point, there are
three options available. First of all, pressing the “Decelerate” button will
slow the motors down to a stop but leave them powered. Pressing the “Run” button
while the script is executing will also do this. This is the preferred option, since it will
put the least stress on the motors. The second option is to press the “Halt” button .
This button will immediately stop the motors from moving, but will still leave them
powered. The last option is to press the “Kill” button . This button will
immediately stop the motors from running as well as cut off all power to them. This is
the least desirable option, since it will put the most strain on the motors.
Once you have created and debugged your script, you have a number of different options.
You can simply save the script to be opened up using the Motion Assistant by going to
“Save” in the “File” menu. You can also export the script to either LabVIEW or as C-
code. To export the script as a LabVIEW program, go to “Generate Code” under the
“Tools” menu and select “LabVIEW Diagram.” This will then create a LabVIEW block
diagram that will perform the same actions as the script. To export the script as C-code,
again go to “Generate Code” in the “Tools” menu and select “CVI Code.” This will
create a file that can compiled using a C compiler that will generate C-code to perform
the actions in the script. Finally, by selecting “Code Recipe” under “Generate Code,”
you will be taken through a step by step process for generating Visual Basic code for the
script.
- 18 -
National Instruments Workstation Help Manual
connected to the system will show up under the “Devices and Interfaces” heading of the
“Configuration” window. Most of the devices will show up either under “Traditional NI-
DAQ Devices” or “NI-DAQmx Devices.” Some unique devices will show up under their
own headings (ex. The PXI-1409 Image Acquisition card will show up under “IMAQ
Devices”). If you right click on the desired device, then select “Test Panels…” from the
menu that pops up, a window should pop up that will allow you to access the device.
These windows have minimal functionality, but they do allow you some control of the
device. This would be useful if you wanted to check to make sure you had to correct
connections before trying to run a program in LabVIEW, or if you just wanted to make a
quick measurement.
Figure 16
SignalExpress
If you don’t want to deal with programming in LabVIEW, SignalExpress is the next best
thing. SignalExpress provides you with most of the signal processing functionality in
LabVIEW, but in a more user friendly form. SignalExpress also has the capability of
interacting with the NI hardware in the PXI-1042 chassis, which makes this program
almost as powerful as LabVIEW itself.
- 19 -
National Instruments Workstation Help Manual
toolbar. This will bring up the following windows. Figure 17 is the main SignalExpress
window while figure 18 is a startup window that will appear.
Figure 18
Figure 17
From the start up window (figure 18), you can access and number of tutorials and help
menus. If you don’t wish to access any of this information, simply click “close.” The
main window is broken up into three parts. On the far left of the window is where the
steps in your program will be listed. The center of the window is where all the data will
be displayed. On the far right of the window is the help menu. You can close and open
this by clicking on the icon directly above it.
Adding signals to the display can also be done in a number of ways. The easiest way is
to click and drag the desired signal over to the graph. You can also add signals by right
clicking on the graph and selecting the desired signal from the “Add Signal” menu.
You can also add additional displays, and like the previous actions, there are several ways
to do this. You can either click the “Add Display” button or right click on
the graph and clicking on “Add Display.” When you click the “Add Display” button, the
- 20 -
National Instruments Workstation Help Manual
program will automatically add a graph at the bottom of the display window. If you go to
the “Add Display” menu after right clicking on a graph, you will have a number of
options as to where to add the new graph (above, below, left, or right). The display sizes
can be changed by clicking and dragging the borders of the displays.
Once you have all the steps and graphs set up, you can run the program by clicking on the
“Run” button . This will cause the program to execute and collect any real time
data from the hardware. The following figure (figure 20) is an example of what your
final program might look like. This simple program starts out with a sine wave, adds
noise to it, then filters out the noise.
Figure 20
When you’ve finished creating your program, you can save it by going to “Save as…”
under the file menu. You will save the file as an Express Workbench file. What’s great
about this is that you can then open that file up in LabVIEW and LabVIEW will create a
block diagram that will do the same thing as the SignalExpress program. To do this, go
to “Express Workbench” under the “Tools” menu and select “Convert Express
Workbench Project…” This will bring up a window that allows you to select the file you
just saved and specify a file location for LabVIEW to create your new program.
- 21 -
National Instruments Workstation Help Manual
suffice. If you need to go back and change the properties from the second window, you
can get to them by going to “Properties” under the “File” menu.
Figure 21
Figure 22
Once all of these preliminary options have been chosen, you will get to the main window
for the program (figure 23). The graph area of this window is where the waveform you
create will show up.
Figure 23
To start creating your waveform, you will need to either click on the “Add components”
button on the toolbar or select “Add components” from the “Edit” menu. Selecting
this will bring up the following window (figure 24). This is where you will add all the
components to your waveform. You can either create single waveforms (sine, square,
triangle, etc) or you can add components together using either the “Insert Primitive before
Current Primitive” or “Insert Primitive after Current Primitive” buttons. By
doing this, you can create more advanced waveforms such as a sine wave with
exponential decay (figure 25).
- 22 -
National Instruments Workstation Help Manual
Figure 24 Figure 25
To view the entire waveform, you may need to zoom out. You can do this by clicking on
the zoom out button then clicking somewhere in the graph window. Once you’ve
finished creating your waveform, you will need to save it. There are two things you will
need to do. First, you should simply save it by going to “Save” under the “File” menu.
This will allow you to come back and edit your waveform as well as read it into the
Function Generator. You can also export the waveform as a LabVIEW Measurement
File (LVM) so you can read it into LabVIEW using the Read LVM Express VI. An
example of the type of waveform you could create is shown below (figure 26).
Figure 26
- 23 -
National Instruments Workstation Help Manual
toolbar. The following window will appear (figure 27). This is the main window for the
digital waveform editor.
Figure 27
You will now need to create a new waveform. Do this by selecting “New Waveform”
from the “File” menu or clicking on the “New Waveform” button on the toolbar. This
will bring up the following window (figure 28). Here you can change the number of
samples as well as the number of signals or channels you will work with. You can
always add more lines using the “Insert Signals” option under the “Edit” menu.
Figure 28
After clicking ok, the graph area in the main window should now have lines for however
many signals you chose to have. If you click on the graph, a blue box will appear. This
is one sample of the line you selected. You can select multiple samples by clicking and
dragging. You can change the bit value of a single sample by using the Toggle Bit
button or you can change the bit value of multiple samples by selecting them and using
the “Fill” option under the “Edit” menu and selecting “All Ones” or “All Zeros”
depending on which way you want to go. There are many other options available under
the “Fill” option. For example, by highlighting multiple rows, you can create a counter
by filling in with either “Count Up” or “Count Down.” You can back to selecting
samples by clicking on the Select button.
Once you’ve finished creating your digital waveform, you will need to save it. There are
two things you will need to do. First, you should simply save it by going to “Save” under
- 24 -
National Instruments Workstation Help Manual
the “File” menu. This will allow you to come back and edit your waveform as well as
read it into the HSDIO Generation Express VI. You can also export the waveform as an
ASCII file so you can read it into LabVIEW using the Read LVM Express VI. An
example of the type of waveform you could create is shown below (figure 29).
Figure 29
- 25 -