07-10-2012 04:58 PM
How are you? My name is Francisco Madrid, I was reading several responses with respect to programming in labview and maybe I can help with this query.
Just what I want to do is generate a wav file that acquired from the microphone of the PC and while that happens to handle the parallel port. Each one second should make a change in output value parelelo port to handle an external circuit.
After several attempts I managed to work, but I like talking to someone of experience to know when is the best way to go.
If someone agrees, I can send the files where you like.
Thank you very much and sorry for the inconvenience.
Madrid Francisco
07-10-2012 06:24 PM
One problem is that your upper while loop in 2.4 will probably run twice. Is that what you want? Assuming the shared variable called "variable" is false when you enter frame 2.4, the shared variable will be read as false and the loop will not stop after the first iteration. The inner sequence structure will run through and the shared variable will be set to True at the end. But because of your race condition where it had already been read as false, the loop will iterate again.
Now the shared variable will be read as false and will stop the loop when the iteration is done, but all the inner sequence structure will all still have to execute to finish the iteration.
In the meantime, the lower while loop will run as many times as necessary as fast as the code inside it allows until the shared variable is read there to stop the loop, which will probably be before the upper while loop as finished its 2nd iteration.
07-10-2012 07:50 PM
Ravens
You are rigth. That` s one of my problems. Should i use a Producer/Consumer (DATA) design patter to fix it? Which would be your advise to record the audio meanwhile we change only for times the parallel port value?
I could send you the files if it's necessary.
thanks for your help