03-10-2010 10:41 AM
Hi all,
I am actually trying to write a measurement file. I will have a waveform coming from oscilloscope and I want to record it after every 15 seconds.
In attached VI, I have simulated signals (the driver that I am using for data aquisition has also got the while loop) and performed analysis upon it. As shown in the screenshot attached, I am using the write measurement file 1 to log the data as soon as the quisition starts and then I am using write measurement filemarked as 2 to get the data after every 15 seconds.
I thought this arrangement should work, but it is not working 😞
Could you please guide me in this regard???? I want to write data to a measurement file for every 15 seconds.
Anxiously waiting for your response.
Best regards,
Haroon
Solved! Go to Solution.
03-10-2010 12:05 PM
You can't pass data between loops with wires. They will not run in parrallel. Your timed loop is waiting for your first loop to finish.
Move WTMF 1 inside of the while loop. For the second WTMF you have a couple of options. The simplest would be to use a local variable to read the information in the timed loop. You could also put the second WTMF in the first loop and use a millisecond timer, a shift register, and a case structure to only write it every 15 seconds. You also need a wait timer in the first loop.
There are a lot of better ways to do this, but those would be the simplest.
03-10-2010 12:11 PM
desk is right. you should try with queues.
here's a labview example (you have one too, so look it up in you help)
03-10-2010 12:11 PM
The use of the timed loop would not be justified at all, imho. Just place an Elapsed Time function in the main loop and wire it to a case statement with the write function inside. Or, use a consumer/producer architecture (File>Open...).
The way you wrote the posted example shows you really do not understand LabVIEW and dataflow. Ever take the tutorials.?
03-10-2010 04:58 PM
Thank you very much for your replies. I have changed my VI and it can record data every 15 seconds now. But now I want to keep it running for 5 seconds. I mean I want data writing every 15 seconds for 5 seconds. How can I make sure that it keeps on writing for 5 seconds???
screenshot and updated VI is attached.
thanking in anticipation
Best regards,
Haroon Farooq
03-11-2010 06:28 AM - edited 03-11-2010 06:29 AM
This is how I do a timer like that, others may have better suggestions. Inside the false case of the structure, place a millisecond timer, multiply the output times 1000 and create an indicator, call this Start Time. Make a local variable of Start Time and place it under your elapsed time function. Subtract Start Time from Present Time (s). Wire this to an is less than operator with a 5 wired to the bottom terminal. Place an OR operator with the output connected to your case structure. The top input of the OR comes from the Elapsed Time function, the bottom input comes from the is less than operator.
I would just show it to you, but it is somewhat difficult for me to get VI's onto my network computer. Let me know if I wasn't clear or missed something.
03-11-2010 07:01 AM