Digital Electronics and Computer Interfacing PH 534
-
Upload
cynthia-nichols -
Category
Documents
-
view
33 -
download
0
description
Transcript of Digital Electronics and Computer Interfacing PH 534
![Page 1: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/1.jpg)
Digital Electronics and Computer Interfacing
PH 534
Tim Mewes
Spring 2011
![Page 2: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/2.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 2
Digital Electronics
• Binary systems with two possible values (logic states):– High/Low– ON/OFF– 1/0– TRUE/FALSE
• First part of the course, after introduction to LabVIEW
![Page 3: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/3.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 3
Computer interfacing
• Connects the digital world to the analog world• One way to communicate with Laboratory equipment is
by using GPIB-commands (General Purpose Instrumentation Bus)
• Data acquisition cards (DAQ-cards) provide another interface between the computer and the outside world
• Second part of the course
![Page 4: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/4.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 4
1. LabVIEW Basics
1.1 Front panel
1.2 Block diagram
1.3 Getting help
1.4 Debugging
Experiment #1
![Page 5: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/5.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 5
1. LabVIEW Basics
Together these two parts constitute a Virtual Instrument – short: VI
A VI is typically build by using other VIs which are then called subVIs
Block diagram:contains the graphicalprogram code
Front panel:the interface to theprogram
<CTRL>-E switches between Block diagram and Front panel
![Page 6: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/6.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 6
1.1 Front panel
1. LabVIEW basics
Toolbar
Pull-down menus
VI icon (right click for short cut menu)
Window title
Area that holdscontrols/indicatorsenables user interaction
(Numeric) controls:Enable the user to enter data
(Numeric) indicator:Displays data
![Page 7: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/7.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 7
run button
broken run buttonindicates coding errors
run continuously button
abort execution button
pause/resume button
1. LabVIEW basics
text settings
align objects
distribute objects
resize objects
reorder objects
show/hide context help
1.1.1 Front panel toolbar
indicates running top level VI
indicates that a VI caller is running
![Page 8: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/8.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 8
1. LabVIEW basics
1.1.2 Controls palette• right clicking in an empty area of the front panel opens the controls palette• choose the general type of control/indicator:
1
1. Numeric controls & indicators
2
2. Boolean controls & indicators
33. String & Path controls & indicators
4 4. Array, Matrix & Cluster controls & indicators
5 5. Graphs (indicators)
![Page 9: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/9.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 9
3 4
5
1 2
1. LabVIEW basics
1.1.2 Controls palette• right clicking in an empty area of the front panel opens the controls palette• choose the general type of control/indicator:
• place the object on the front panel:
left click
• type in a name for the control, finish with or by clicking on an empty spot of the front panel avoid using generic names like “Numeric”!
1. Numeric controls & indicators
• from the submenu choose the desired control/indicator
![Page 10: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/10.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 10
1. LabVIEW basics
1.1.3 Short cut menus• right clicking in different areas of a control opens different short cut menus
• changes a control into an indicator and vice versa
• opens the properties dialog box
Can be used to change the default value, data range, label, documentation and many more properties of objects.
![Page 11: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/11.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 11
1. LabVIEW basics
1.1.4 VI icon and connector pane• right click on the icon opens the short cut menu
• always design your own icon for your VIs avoid using the standard icons!• many times you will only see the icon of your VIs
• opens the icon editor:
• shows the connector pane of the VI
the connector pane is used to define inputs and outputs of subVIs(will be discussed in detail later)
![Page 12: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/12.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 12
1. LabVIEW basics
1.1.5 Icon editorPencil: Draws and erases pixel by pixel.
Line: Draws straight lines.
Color Copy: Copies the foreground color from an element in the icon.
Fill: Fills an outlined area with the foreground color.
Rectangle: Draws a rectangular border in the foreground color.
Filled Rectangle: Draws a rectangle with a foreground color frame and filled with the background color.
Select: Selects an area of the icon to cut, copy, move, or make other changes. Text: Enters text into the icon. Double-click this tool to
select a different font. While text is active, you can move the text by pressing the arrow keys.
Copy from: Copies from a color icon to a black and white icon and from a black and white icon to a color icon.
Foreground/Background: Displays the current foreground and background colors. Click each rectangle to access a color picker from which you can select new colors.
![Page 13: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/13.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 13
1. LabVIEW basics
1.1.6 Tools palette
• <SHIFT> + right-click or select it in the “View” pull-down menu• Used to modify the cursor appearance and its functionality
Operating Tool
Positioning/Resizing Tool
Labeling Tool
Wiring Tool
Shortcut Menu Tool
Scrolling Tool
Breakpoint Tool
Probe Tool
Color Copy Tool
Coloring Tool
Automatic Selection Tool (off): Keep it on!<SHIFT>+<TAB> turns it back on
![Page 14: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/14.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 14
1.2 Block diagram
1. LabVIEW basics
Toolbar
Pull-down menus
VI icon (right click for short cut menu)
Window title
Control terminals
wire
function node
Indicator terminal
This is where the program code is “written”
![Page 15: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/15.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 15
debugging features
Step Over executes a node and pauses at the next node
Execution highlighting enabled
retain wire values saves data values
1. LabVIEW basics
Highlight execution buttonenables/disables execution highlightingdata flow will be visible
Step Into opens a node and pauses
Step Out finishes executing the current node and pauses
1.2.1 Block diagram toolbar
![Page 16: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/16.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 16
1. LabVIEW basics
1.2.2 Functions palette
• right clicking in an empty area of the block diagram opens the functions palette• choose the general type of node you want to insert:
1. Structures (For Loop, While Loop, Event Structure, etc.)1
2. Array functions (Array size, Index Array, Build Array, etc.)2
3. Cluster & Variant functions
3
4. Numeric functions (Add, Subtract, Multiply, etc.)
4
5. Boolean functions (AND, OR, XOR, etc.)
5
6. String functions (String length, Concatenate Strings, etc.)
6
7. Comparison functions (Equal, NOT equal, greater, etc.)
7
8. Instrument I/O (Data acquisition & interfacing)
8
9. User Libraries (your own VIs)
9 • place the actual object on the block diagram
![Page 17: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/17.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 17
1. LabVIEW basics
1.2.3 Wiring objects
• once you move the cursor over an input (or output) terminal it changes to the wiring tool
• left click starts a wire
• moving the mouse creates a wire (dashed line)
• left click again over an output (or input) terminal
![Page 18: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/18.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 18
1. LabVIEW basics
1.2.3 Wiring objects
• wiring errors are indicated by broken wires
• moving the wiring tool over a broken wire displays a tip strip that describes why the wire is broken
• <CTRL>-B removes all broken wires on the Block diagram
![Page 19: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/19.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 19
1. LabVIEW basics
1.2.3 Wiring objectsWiring “Hot Spot”
Clean Up Wiring
Left Click To Select Wires
![Page 20: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/20.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 20
1. LabVIEW basics
1.2.4 Short cut menus• right clicking on terminals, function nodes and wires opens different short cut menus
• terminals: - find the corresponding object on the front panel - hide the corresponding object on the front panel - change the properties of the object etc.
• function nodes: - create a constant, control or indicator for a particular input or output – very useful etc.
• wires: - create a constant, control or indicator - clean up the wire - set/clear breakpoints etc.
![Page 21: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/21.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 21
1. LabVIEW basics
1.3 Help
• <CTRL>+H, or “Show Context Help” from the Help pull-down menu toggles the Context Help on and off• Move the cursor over the Block diagram object you are interested in
• Using <CTRL>+?, F1 or “Search the LabVIEW…” from the Help pull-down menu you can get more detailed help• Besides help for different LabVIEW components tutorials are also available (PDF-files) try for example to search for “getting started how-to”
• Use “Find examples” from the Help pull-down menu to find example VIs for a specific task
• Make yourself familiar with the LabVIEW help!
![Page 22: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/22.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 22
1. LabVIEW basics
1.4 Debugging
• Click on broken Run button: a Window that explains the error and possible solutions appears
Locating errors:
• Click on Execution Highlighting button; data flow is animated using bubbles. Values are displayed on wires.
Execution Highlighting:
• Right-click on wire to display probe and it shows data as it flows through wire segment
• You can also select Probe tool from the Tools palette and click on the wire
• If retain wire values is on the last data flowed through the wire at the last VI execution is shown immediately
Probes:
![Page 23: Digital Electronics and Computer Interfacing PH 534](https://reader036.fdocuments.in/reader036/viewer/2022062321/5681365b550346895d9de594/html5/thumbnails/23.jpg)
01/11/2007 Digital Electronics and Computer Interfacing 23
1. LabVIEW basics
1.4 DebuggingBreak points:
• Right-click on a wire or node to set/clear a break point
Continue execution until the next break point or the end of the program
Step Over executes a node and pauses at the next node
Step Into opens a node and pauses
Step Out finishes executing the current node and pauses