LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

audible alert to indicate the occurrence of an event using lvsound2.dll

Solved!
Go to solution

I'm fairly new to LabVIEW, but not new to programming. 

 

I'm trying to implement a VI which gives an audible alert to indicate the occurrence of an event using Play Sound File.vi.

 

A .Wav file is set to be played, after a certain flag is tripped to indicate the occurrence of an event. While my VI works well before compiling, it does not give an output after compiling. I cannot seem to get the same performance once the code is compiled as a Source Distribution (as a .llb, which is what I want) or as an Executable. 

 

I have attached a sample code where I have replicated the problem. In the sample code I have assumed the event has occurred (flag tripped) and set the .Wav file to be played until the flag is reset. I gather this is probably not the most elegant way, but I'm trying to understand why compiling the .VI stops the sounds being played.

 

Any thoughts/comments are greatly appreciated.

0 Kudos
Message 1 of 8
(2,878 Views)

t works when I compile it.

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 8
(2,847 Views)

Thanks for that, Paul. Did you compile it as an executable? or as a Source Distribution?

 

0 Kudos
Message 3 of 8
(2,824 Views)

If you want help with turning this into a DLL, attach the project you're working with and a calling VI to show an example of how you wish to call it.  Without that, we can't tell what isn't right.  We can only take the steps we'd take.

0 Kudos
Message 4 of 8
(2,818 Views)

I compiled it to a .exe

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 8
(2,807 Views)

Thank you, natasftw. 

 

Please see attached. 

0 Kudos
Message 6 of 8
(2,784 Views)

Thank you, paul_cardinale. 

Compiling it into an executable seems to work for me too. However, it doesn't seem to work when I compile it into a .llb (Source Distribution). I need to compile it into a Source Distribution as I use this VI through another application (also developed in LabVIEW). I can recompile the application if necessary. 

0 Kudos
Message 7 of 8
(2,783 Views)
Solution
Accepted by topic author hkd2015

Fixed.

It seems I made a mistake in the files path of the support directory structure, when compiling as a Source Distribution (which may have prevented the lvsound2.dll being accessed).

 

 

0 Kudos
Message 8 of 8
(2,755 Views)