12-22-2014 01:15 PM
Hi.
I read data with VISA read function and then I use functions like multiple for showing data on Chart. every thing is OK.
now I want play a specified sound (like a 3s song in my desired folder) when signal amplitude cross over from specified value. then after desired time, it will be wait for new cross over from specified value and this procedure repeat again until I stop the program.
Data comes from MCU and it doesn't stop when system play sound and when system play sound, incoming data for this part (play sound) will be ignore them until specified expired.
I use this VI for reading data and mentioned part which is sound part is empty and I don't know what I must done ?
altougth I use another while loop for sound apart because I want save CPU time.
Thanks.
Solved! Go to Solution.
12-22-2014 01:34 PM
Use a notifier to tell the second loop when to play the sound file. By passing the wire, you are creating a data dependency and therefore both loops will not run in parallel.
12-22-2014 02:55 PM
Thanks for reply.
my question has 2 part.
1. exceute two while loop paralel which means both work in time ?
2. how I can play a specifeid song for specified duration ?
I see labview example for notifer and change my first VI to this :
with up VI, can I use two while, simultaneusly ?
for playing sound with mentioned circumstances in first post, what I can done ?
Thanks.
12-22-2014 03:01 PM
I would recommend making the data type of the notifier a cluster that contains a path and a numeric (double). The path tells the player which file to play. The numeric is the duration.
Now for a slightly complicated, but really neat, way to stop your second loop. Do not use a second notifier. Instead, send the normal notification but use Not A Path for the path in the cluster. Your second loop can do a check for the Not A Path and stop when that is recieved.