LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using labpro with labview (automatic guitar tuning project)

I am a high school student at MLK Magnet School and in my Engineering Development and Design class my team is trying to create an automatic guitar tuner. We've had to make compromises and use hardware that David Vernier @ www.vernier.com is loaning to us for this project, but we're not at all comfortable with LabVIEW.
He sent us LabPro, the microphone attachment, a stepper motor, Logger Pro, some Sample DCU apps, the DCU, and the DCU power adapter.
We've wired the stepper motor that he gave us to the board and the DCU to that, and we've run the program called DCUSTEP3 to make sure it all worked, and it did! But the next step was trying to get Logger Pro to give us proper frequency values (which we are currently having trouble with, but we e-mailed Mr. Vernier and are waiting for his response) which we need to somehow, in real-time, import into LabVIEW.
What we want to do is to turn the stepper motor (either clockwise or counter-clockwise) when the derived frequency is either greater or less than a set range. We really have no idea how to go about doing this and would be very appriciative of any help that we could get.
Thanks!

Message Edited by jclay on 03-24-2006 06:25 PM

0 Kudos
Message 1 of 6
(3,582 Views)

Hello,

 

Wow, sounds like a pretty advanced high school class!

 

With regards to your question, the first thing to iron out is exactly how the logging software can transfer data to your computer, then to define exactly what you mean by “in realtime”.  There are several possible ways to transfer data from one running program to another.  Some of the more popular ways are:

 

1) File IO – server writes data to a file, client reads data from the same file

2) ActiveX – Microsoft technology that allows sending/receiving data and automating programs

3) DLLs – half-compiled code allows a program to call code created from another development environment.  For example, a LabVIEW program can call a DLL built with MSVC++.

3) .NET frameworks – similar to ActiveX in look and feel, but closer to DLLs in functionality.

4) Transfer protocols – hooks up serially to another device, GPIB, Ethernet, USB, or something of this sort.  In addition to it just being able to hook up to a computer through these means, the software you write will need to know how to interface with the device and software through these means.

 

Next, what do you mean realtime?  I presume you mean that you just want to read the data from the device continuously and have only a very small delay between each data transfer. 

 

If you can get information on how you can transfer the data, and how quickly you want to transfer the data I might be able to help recommend a way to get the data to LabVIEW.

 

Good luck-

Message Edited by Travis M. on 03-27-2006 04:16 PM

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 6
(3,558 Views)
The Labview basic code would involve having subvi's to control the stepper motor, and a subvi to read the frequency from a DAQ or other board, or to process the signal from a microphone to obtain a fundamental frequency.
Compare the incoming frequency to the desired frequency:  You may never get an exact match, and you wouldn't want to be tuning forever, so you will have to choose a window where you consider the tuning to be "in tune".  For example, if tuning to 440Hz (I believe that is an A note), you might want to use the In Range function (functions palette - Comparison), and set the high limit to 440.1 and the low limit to 439.9.  If the output is false, then you will have to use greater than and less than functions to see if the frequency is too high or too low.  If too high, send a command to the stepper motor to turn in the direction that will loosen the string.  If too low, send a command to turn in the direction that will tighten the string.  You can use a case structure to perform the desired command.  You will have to repeat the entire sequence of events in a loop until the In Range comparison returns a True.  Here is an example vi for a starter.
 
 
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 6
(3,552 Views)
LabPro connects to the computer via a USB connection then to a DCU unit (digital connection unit) which then connects to a motor. LabPro also also connects to the microphone. We would like to have LabVIEW see LabPro's DCU and the microphone directly somehow, but as of right now we aren't too sure how to go about doing that.
Otherwise, using the different file-types seems like an appropriate (and expected) response.

Thanks for the help!!!

-josh
0 Kudos
Message 4 of 6
(3,546 Views)
That's exactly what we were planning on doing (conceptually), but we have never used LabVIEW and aren't too sure where all of the buttons are located and what they are called. I have personally done some C/C++ and BASIC programming so once we figure out the way that LabVIEW works out we should be okay.

Thanks for the help!!!

BTW: our project is due April 10th !!!
0 Kudos
Message 5 of 6
(3,546 Views)
LabPro should come with a DLL file that has functions that communicate with LabPro, including getting microphone data, controlling the stepper motor, etc.  Did you get a manual with LabPro, and a DLL file?  Labview has a Call Library Function Node (found in Advanced palette) to make DLL function calls.  There are many examples on DLL calls in the example finder and on NI website.

Message Edited by tbob on 03-28-2006 09:43 AM

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 6
(3,534 Views)