12-01-2005 11:43 AM
Vitvip:
That's pretty 'cool' and thanks for taking the time to answer. So you rectify the output of the soundcard, changing to a DC level which is amplified to power the heater. Now I beleive I understand. Wish I could give feedback on sound output, but I have no experience 'hear'. An analog out DAQ card would appear to be a more conventional approach.
Good Luck, your work 'sounds' interesting.
-Pete
12-02-2005 09:20 AM
Vitvip,
I guess I don't understand what you mean by "controllable". I can have the computer generate a tone without a break (silence) in the generation of that tone. I cannot, however, vary the amplitude or frequency of that sound. I've attached two VIs, one for LabVIEW 6i and the other for LabVIEW 6.1. They both output continuous sound from your sound card but the frequency cannot be changed once the program is begun unless you stop and restart the task. Let me know if this helps out.
Best Regards,
Chris C
Applications Engineering
National Instruments
12-02-2005 09:55 AM
Chris,
thank you for being that explicit, your VI's of course work. Though I insist that you _can_ control frequency and amplitude. Just change it right after the start and wait a little. This delay is huge (for me) and thus in fact you are right that you _cannot_ control the parameters.
And of course by 'controllable' sound output I mean the ability to change the amplitude of the sound anytime without significant lag. Please see my post with the details of the whole setup, it may help to better understand the problem.
Thanks again.
Best wishes,
Vitaly
12-05-2005 01:03 PM
Hello All,
The issue here is the way the sound write VI functions (and on a lower level it
might be the way Windows functions). Take a look at Chris's VI and notice
that in "highlight execution" mode, you should be able to change the
frequency of the wave and notice the results immediately. Switch back to
regular and the response is greatly delayed. This was a huge clue as to
how that VI works! The VI is buffering the data from the waveform
generator. For instant response from your soundcard you will have to
delay the execution of that loop until the time that the soundcard is caught
up. You can either put a delay in the loop (I found that on my machine
40ms was about perfect), or you could use the sound wait VI (in LabVIEW 6.1 it
is a VI mixed in with the other sound output VIs). If you use the sound
wait VI, you are guaranteed to have the buffer cleared before the next waveform
is played, but you will hear a break in the sound. If you use the delay
method, timing it perfectly might be an issue. Unfortunately with this
older (non-supported) version of LabVIEW, this may be the best we can do.
While this may be the best LabVIEW 6 can do here, you might have some luck
calling external code. You might be able to find some Windows API calls
which can output sound, or you might be able to find an ActiveX control witch
can do it.
Please let us know if you have any additional questions on this!