PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to play audio from RT mode?

If I'm running a program on a PXI controller in RT mode, is there any simple way for the program to provide audio feedback? It occurs to me that there must have been at least some interest in such a feature in the past.

Previously I thought the only way to do this would be to set up some sort of communcations with a VI running on another computer networked to the PXI, and then use the audio hardware in that computer. This seems too complex to be worthwhile.

Another thing that comes to mind is that there might be some cheap USB (or perhaps even serial?) audio device that could be controlled from RT mode, but this also seems unrealistic. (However, I remember reading, way back in the DOS days when sound cards were still really expensive, about a parallel device with such capabilities.)

There wouldn't be some other way for the PXI to access audio hardware on another device, would there?
0 Kudos
Message 1 of 5
(4,271 Views)
Kehander,

Unfortunately, LabVIEW ETS (The RT operating system) doesn't have a nice audio driver API like Windows does.  Also, the overhead of having support for USB audio devices would hardly justify the small benefits.  So, in short, you can't use standard audio drivers with Real-Time.

What kind of audio feedback did you want? A beep? Or a symphony?

Here's an idea: If you're using your RT system with a multifunction DAQ card, and you have a spare analog out channel, it wouldn't be too difficult to read in a WAV file as a waveform array and output it to one of those channels whenever you wanted to make a nice sound. 

Or, if you have a digital I/O card of some sort, you could wire it up to a beeper/buzzer of some sort.
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
Message 2 of 5
(4,263 Views)
Clever. I hadn't thought about doing it that way; I suppose that's how people got around it previously. I guess I would have to get a BNC to mini-stereo adapter.

Anyway, my PXI-6280 is only capable of generating counter pulses, which I suppose could be made into an appropriate sound, except that I don't think the voltage is adjustable in any way. Do you know offhand if it would be too much for a standard speaker to take?
0 Kudos
Message 3 of 5
(4,260 Views)

Yeah, you could easily generate a square wave off your counter which would make a nice annoying buzzer sound!  Only thing to keep in mind is that your DIOs are limited to about 20mA of output current.  Since the DIOs (which is what the counter would output to) are 5V, you don't have to worry about blowing a speaker.  You would want to definitely add a resistor inline there to keep the total resistance such that you're not flowing more that 24mA.  Since speakers are typically 8ohms or so of DC resistance, use at least a 250Ohm resistor inline.  (5V / 258 ohm  < 20 mA). 

I think that should be enough to make a decent racket at a higher frequency, probably at least 1000Hz. Play around with it. Remember that perceived sound level increases with frequency for a given power output since you move less air at higher frequencies. Here we have a max power output of .1 watt:  (5v * .020A). 

 

--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 4 of 5
(4,256 Views)
I forgot to add, if you're not driving a speaker directly, then you don't have to worry about inline resistors as the input impedance of an amplifer is very high and there will be little current flow.
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 5 of 5
(4,254 Views)