09-30-2011 08:21 PM
Thanks for taking the time to read my question.
I'm doing the following system for my university proyect:
An audiofrequency signal (0 - 20 KHz) is sampled by the PIC18F4550 ADC (AN0), and its sent to PC via USB Bulk transfer. At the PC, LabVIEW 2010 receives the data throught a subVI created by José Adrián Pérez Cueto (picusb.vi). Now, when LV receives the data, the program must reconstruct the signal, and finally, do the spectral measurements in order to show the spectral components in a graph.
Ok, now I explain my problem:
The subVI receives the data correctly, and I successfully converted the data to digital waveform, but I fail when trying to convert to analog waveform. I need analog waveform for doing spectral measurement to that.
My questions:
How can I successfully obtain the correct analog waveform for doing the spectral measurement to that?
Is there another way for getting the spectrum graph with the obtained data from the subVI?
Attached in a zip file:
Thanks for your help! Any redaction error, excuse me, english is not my mother language...
10-01-2011 11:17 AM
I suspect that you do not want a digital waveform. Is the array of U8 coming from the picusb.vi the output of the PIC analog to digital converter? If so, then just use that array as the Y array in an analog Waveform. Use the Build Waveform primitive.
Lynn
10-01-2011 11:44 AM
You're right, I need an Analog Waveform for doing the Spectral Measurements to that, and the U8 array is, in effect, coming from the PIC ADC.
Now, I've been trying to use that array as the Y array in the Build Waveform, but there is something that I'm doing wrong, or maybe I'm forgetting something, because I haven't successfully build the waveform.
How must I input the rest of the Waveform components into the Build Waveform primitive? Because it has 4 components, and the Y array component will be the U8 array:
Mainwhile I get response, I'll be trying to discover it myself...
10-01-2011 02:14 PM
Connect the U8 array directly to Y. Eliminate the Digital Waveform and the D/A conversion.
Use Index array rather than Array to Cluster and Unbundle.
Lynn
10-02-2011 04:22 AM
Your PIC microcontroller have a 10 bit ADC. So you must use the U16 datatype. Then you can convert this to volt. I have made a quick and dirty example. In this example I have assumed you are using 5 volt as your ADC reference. I did also not know the endian format of your conversion result. I have not tested it nut it should work I hope
10-02-2011 06:43 AM - edited 10-02-2011 06:47 AM
Well Coq Rouge, I'm sorry for telling you that my LV version is 2009. I commited a mistake in my first message...
I'll try to get LV 2010...
10-02-2011 08:42 AM
here it is in 8.6 I hope
10-02-2011 09:02 AM
No, is the same VI file.
You must click File -> Save for previous version
10-02-2011 10:15 AM
@MetalKaiser wrote:
No, is the same VI file.
You must click File -> Save for previous version
I do not know what went wrong
08-17-2012 05:13 AM