01-26-2010 03:30 PM
I would like to continuously sample the PC sound card and perform processing to find certain signal characteristics in the incoming data. When these characteristics are found (I'll call this an event), I'd like to then record the incoming data to a fixed length WAV file. I can do all of this today with no problem.
However, what I'd really like to be able to do is to continue to sample and process the incoming data while recording. If another event occurs while recording, I'd want a second (or third or fourth or fifth) file to start recording at the same time.
I'm pretty sure this is doable given the parallel capabilities of LabView, but I'm having some trouble coming up with a program architecture that allows it. Any suggestions on how to set this up would be appreciated.
Thanks,
Andy
01-27-2010 10:56 AM
Hi Andy,
I think a good place to start is to read about Producer/Consumer and Master/Slave design patterns- there are also templates for these design patterns in LabVIEW (File >> New...)
You might want to post what you have so far so recommendations can be made from that.
Kristen H.
01-27-2010 11:10 AM
Andy,
I guess what you need is a design where you can invoke multiple processes running in separate threads. I know you can launch multiple instances of vi template (must have .vit extention), so if you encapsulate all recording related code in a template and then call the template every time the event occurs you should be able to achieve this goal.
Serge
01-28-2010 12:54 PM
Kristen,
Thanks, I think the Master/Slave arrangment might work. I could have a master checking for events and then multiple slaves, one for each simultaneous recording. I'd be limited by the number of slaves, but that might not be a crippling limitation.
Serge,
I think you're right about multiple processes in several threads. I'm not exactly sure how to call multiple instances of a template as you're describing without using a Master/Slave arrangement as Kristen suggested. Do you have an example you could share?
Thanks,
Andy