From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a CD player for a car in Labview?

I am attempting to make a car CD and radio system for a project i am working on for my university degree.

 

I am having trouble with making the start and stop and pause functions for the VI. Getting the file to play has been achieved and i do have a start button around a case structure.  But getting the program to pause the file from the same start button and start again from where it left off and getting the stop button to stop the wav file and reset it is proving more difficult.

 

At the end i will have about 12 tracks to be cycled through, with a previous and next buttons. could u help me design this vi...

 

Hope to hear some good news soon!! hehe any vi's u can send me would also help(assuming they do help ^^)

 

Andy

university systems engineering student

0 Kudos
Message 1 of 7
(3,270 Views)

It is hard to say without your code, and since this is for a university project I cant give you too much help, but I would look at an overall architecture of a state machine or possible a queued state machine.  your states could be :

idle:no cd, error, playing, paused idle:cd loaded then your transitions fro the state play are to pause if pause is pressed, idle:cd loaded if stop is pressed, Idle:no cd if eject is pressed. and so on...

The queued state machine architecture is more complex but even more flexible where you can queue up multiple states to execute depending on the user inputs.

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 7
(3,244 Views)

Heres a quick tip just in case you run into this issue later on :

To my knowledge, the only sound file type supported by LabVIEW is .wav

So dont try to make any MP3 CD's, etc.

Cory K
0 Kudos
Message 3 of 7
(3,231 Views)

Well tbh falkpl being a systems engineer does kinda involve using other people with more understanding and knowledge to gain the results that u want to obtain ^^ thats just a side note....

 

But yeah anyway i am still having major problems with the start/pause button being the same button...since the mechanical action is for it not to latch its hard to come up with a solution....

 

Any ideas guys? or do u want me to screenshot the play vi for the wav file i am using to see if u can use that?

0 Kudos
Message 4 of 7
(3,187 Views)

From Labview help

Sound Output Stop VI

Owning Palette: Sound Output VIs

Installed With: Base Package (Windows, Linux)

Stops the device from playing sound from the buffer. Use the Sound Output Clear VI to clear the data in the buffer. Use the Sound Output Start VI to restart output. I have not tested it. Also take a look at the Sound Output Write VI and the timeout control

Good luck



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 7
(3,167 Views)

BloodPhoenix wrote:

Well tbh falkpl being a systems engineer does kinda involve using other people with more understanding and knowledge to gain the results that u want to obtain ^^ thats just a side note....

 

But yeah anyway i am still having major problems with the start/pause button being the same button...since the mechanical action is for it not to latch its hard to come up with a solution....

 

Any ideas guys? or do u want me to screenshot the play vi for the wav file i am using to see if u can use that?


Are you using the event structure to handle the UI events? With that it should be really a piece of cake to handle that. Depending if you want icons to be visible you could either customize the true and false images of the boolean or another approach would be to have one button for each operation, aligned above each other and make the one visible that changes to the operation not currently active.

 

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 7
(3,133 Views)
You should try something like this. Use the start sound and stop sound VIs for controlling the sound


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 7
(3,119 Views)