10-02-2015 09:11 AM
Hello,
I bought som low priced capacitors from china (ebay). I have a little old but fine multimeter Kethley 196 DMM, Iam very begginer of labview. I decided that measuring serial resistance of these capacitors with sound card and DMM could be a very good excercise.
First I developed in labview function generator with sound card capable to generate sinusoid signal about 20 Hz - 20 kHz. The program gradually increases frequency from 0 Hz to 22050 Hz in choosed steps (usually 10Hz) in while loop. After this I connected my Kethley multimeter and I put reading voltage values into while loop. But at this point I ran into a problem:
In the while loop when I read values from multimeter (is little slow) the program stops generating sinus signal from sound card and it mess up the measurement. When I connecting speaker to the sound card I hear quenched pipipipipipii sound instead of piiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii. Wihtout reading from multimeter is evrything is fine and the sound (of sinus) is constanty piiiiiiiiiiiiiiiiii.
Can anybody help me how can I solve this problem? Thank You.
Also the program logs the data into a file but now it isnt important. I attach .vi file from project and driver for multimeter.
10-02-2015 09:52 AM
If I understand your problem correctly it could be that your multimeter input impedance is too low and you are loading the circuit down.
10-02-2015 04:13 PM - edited 10-02-2015 04:17 PM
No..
The problem is: when the while cycle reads from VISA port (Keythley 196 DMM) its not doing anything else (maybe its only waiting), and not generating sine signal from soundcard.
Like this in pseude code (very simplified):
while{
generate_sine_signal; //there is signal from soudcard
read_from_multimeter; //no signal from soundcard, maybe ist only waiting
save_to_log_file;
}
Because of this from speakers (when I connect speakers) I hear bibibibibibibibib, Istead of biiiiiiiiiiiiiiii.
I need to modify sound.vi to no stop generating sine signal when the while cycle reads VISA port.
10-05-2015 01:56 PM
Hi Woodwax,
I was taking a look at your code, and I think it might be worth using parallel loops - one that controls the wave generation and output, and another to control the VISA communication. This may resolve the issue for you.
I would also highly suggest that you take a look through the examples that ship with LabVIEW (if you haven't already). To get to them, go to Help > Find Examples.
Regards,
G-IV
10-05-2015 02:48 PM
Hello
Thank you for the aswer, this is a good idea, tomorrow I try it.
10-06-2015 03:49 AM
I trying to paralize into two while loops. But now its executing only while loop 2 (see sound.vi).
while loop 1 is going after stopping while loop 2.
Where is the problem how can I paralize these two loops?
10-06-2015 07:39 AM
Hi Woowax,
This is an issue with data flow and code execution. To understand what is going on here, I suggest you study our LabVIEW basics tutorials that you can access online.
Introduction to LabVIEW (I have this set to open in a new page)
For a tutorial that specifically addresses this, I suggest watching our Graphical Programming tutorial videos, while keeping in mind how the While Loop 2 in the Sound VI has an output running into While Loop 1.
For passing data between while loops, it would be worth taking the time to study up on Queues. The first link I think you should look at is: What Is a Queue? - A broad overview of what a queue is. The second link I would suggest taking a looking at is an example of a pair of while loops running in parallel that are using a queue to pass data from one loop to another: Using Variants to Pass Multiple Data Types Through a Single Queue (I have this link set up to open in a new page).
Also, I cannot stress enough how helpful the examples that ship with LabVIEW can be - especially when you are first starting out. Here is a link that shows how to access those examples: Finding Examples for LabVIEW (I have this link set up to open in a new page).
Regards,
G-IV