LabVIEW notes II

advertisement
ME 392
23 January 2012
Week 3
Joseph Vignola
Assignment 2
Assignment 2 is due Friday, January 27
Please e-mail you submission as a single zip file that contains all
the VIs you created for each problem and an MS Word file that
explains what you did.
I recommend that you make or use a MS Word template
I posted one on the class webpage
Assignment 2
Assignment 2 is due Friday, January 27
The MS Word file should have a name like “ME 392 assignment 2
your name.docx”,
The zip file should have a name like “ME 392 assignment 2 your
name.zip” and
The VIs should have names like “ME 392 assignment 2 problem 1
your name.vi”.
The MS Word file should have your name, your partner’s name
the assignment name, the class name, and the date. You should
also include some brief explanation of what you did for each
problem.
Things to Remember
Signals carry information not power
Switch partners for each lab and assignment
Share code only with one lab partner
Do not share text with anyone
Things to Remember
In the first assignment you learned how to
make manipulate number and strings in LabVIEW
display items
Sort numbers
Use programing structures
For Assignment 2
You will work with arrays of numbers
Pass a signal out and back into the
2120 box
Save data to a file
Taken from NI.com
For Assignment 2
For problem 1
I used the random number generator to make a random
array
For Assignment 2
For problem 1
I used the random number generator to make a random
array
For Assignment 2
For problem 1
I used the random number generator to make a random
array
Then made a sub-vi of that
I posted the sub-vi called random 2d array in a
zip folder called ME 392 VIs on the class web
page.
For Assignment 2
For problem 1
I used the random number generator to make a random
array
Then made a sub-vi of that
I used a “flat sequential structure” to control the
sequence of things that the program is doing
First stuff
For Assignment 2
For problem 1
I used the random number generator to make a random
array
Then made a sub-vi of that
I used a “flat sequential structure” to control the
sequence of things that the program is doing
First stuff
Second stuff
For Assignment 2
In the second box of the “flat sequential structure” I used
a true / false “case structure” so that I could average
either the rows or columns
I also used “property node” so that I could control (turn
no and off) what was being displayed
make a “property node” for an indicator
1) right click the indicator
2) create
3) property node
4) visible
For Assignment 2
In the second box of the “flat sequential structure” I used
a true / false “case structure” so that I could average
either the rows or columns
I also used “property node” so that I could control (turn
no and off) what was being displayed
make a “property node” for an indicator
1) right click the indicator
2) create
3) property node
4) visible
Then right click the node and “Change all to write”
For Assignment 2, Problem 2
You will need to create and display a signal
This is something that you will be doing a lot of this
semester
To make the signal that has noise I used the
For Assignment 2, Problem 2
You will need to create and display a signal
This is something that you will be doing a lot of this
semester
To make the signal that has noise I used the…
For Assignment 2, Problem 2
You will need to create and display a signal
This is something that you will be doing a lot of this
semester
To make the signal that has noise I used the…
to make a signal
and add noise
For Assignment 2, Problem 2
I used the curser and a right clicks to make controls for
For Assignment 2, Problem 2
I used the curser and a right clicks to make controls for
• the tone (the signal)
• the noise
• sampling parameters
For Assignment 2, Problem 2
I used the curser and a right clicks to make controls for
• the tone (the signal)
• the noise
• sampling parameters
Then I made a graphical display from the front panel
For Assignment 2, Problem 2
I used the curser and a right clicks to make controls for
• the tone (the signal)
• the noise
• sampling parameters
Then I made a graphical display from the front panel
I then put all of this in a for loop so that I could generate
the signal with noise some number of times…
For Assignment 2, Problem 2
I used the curser and a right clicks to make controls for
• the tone (the signal)
• the noise
• sampling parameters
Then I made a graphical display from the front panel
I then put all of this in a for loop so that I could generate
the signal with noise some number of times and then the
column averaging from the first problem
For Assignment 2, Problem 3
For this problem I would use the “DAC
Assistant” to send a signal to the “BNC
2120” box and a second “DAC
Assistant” to read the signal.
BNC 2120
Taken from NI.com
For Assignment 3
You will:
• Use handle graphics in Matlab
• Create, play and record signals using Matlab
This is all explained in the Matlab notes that are posted
in the class webpage
Download