LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing data in different intervals than DAQ

Hallo
Would anybody please know how to write data to a file in different timing than the actual acquisition? Actually I acquire seven different channels than I average every 100 points and what I would like to do is write this one average value of each channel into a file. I use a sequence inside of a Do While loop but what happens is that If I do not use any timer inside of the sequence it works fine but If I insert a timer it somehow crashes. The reason I put the sequence in was to write the data that are already averaged otherwise it always writes the data every 10 ms no matter whether I average or not which is not what I want since the files would be too big to handle.
Thank you very much for any suggestions

K
arlito
PS: the file is called trialAI6
0 Kudos
Message 1 of 7
(3,051 Views)
Put the acquisition and filing in different loops running in parallel at different rates. As the data is aquired, transfer it to the other loop via a queue or functional global. When the 100 points are accumulated, average them and write to the file. Put a time delay in each loop so that the scheduler will allow each of them to run as neeeded.

Lynn
0 Kudos
Message 2 of 7
(3,051 Views)
Hallo Lynn

Thank's a lot for your suggestion. But I am not sure If I get what you're saying. Do you mean to have two parallel Do While loops that one only acquires the data and the second does the averaging plus writing file I/O ??? I don't really know what queing stands for. So there is no way to do it in a single loop. Since that means to skip the express reducing data VI and just use a shift register in the other loop. Is that what you meant ?

Sincerely

Karlito
0 Kudos
Message 3 of 7
(3,051 Views)
The queue is a means of transferring data between the two loops without creating a data dependency. I have attached an example. The Acq queue transfers data (in the example the string "data") from the Acquisition loop to the Analysis loop. The Analyze queue transfers the value of the Stop button from the Analysis loop to the Acquisition loop so that one control stops both loops.

All of your data hanlding algorithms and VIs can be exactly the same. You just decide which loop is the best place for them. I usually put only the acquisition VIs in the Acquisition loop and all data handling, analysis, data reduction, etc. in the Analysis loop. Many times I have a third loop for displays and user interface.

I hope this helps to clarify
this approach.

Lynn
0 Kudos
Message 4 of 7
(3,051 Views)

hi johnsold
hi  i am also searching for the this thread ,but i am having one doubt. i am doing acqustion for 5 hours ,where i want to write the data paralelly 5 mins a data  and also display the result also ...
------------------------------------------------------------------------------------------------------------------
Indrajit

| indrajitbarve@gmail.com | indar_indar2005@yahoo.co.in .
0 Kudos
Message 5 of 7
(2,782 Views)
Usually it is better to start a new thread than to append to one which is 4 years old.

Did you look at my 2Loop.vi example which I posted above? Just set the analysis and save VIs to write to the file every 5 minutes and to update the displays a few times per second or slower, depending on how fast it needs to update.

Lynn
0 Kudos
Message 6 of 7
(2,779 Views)
yes , i am new to this concept help me
      i am using that one ,but the program is locking , my require ment is when the data acqustion is going on i want to write the data into the files aswell as i want to display .i done the display part its ok
when writting ,i want to write the file as 5 min data the file name should be the start time of the 5 min data . like that it will go upto 5 hours ..
where i want to put the outer loop and how i want to know how to check the 5 min elapsed .
here with i attached the vi 
instead of reading form the instrument u just use some random num 1 d array of 401 points
help me
give some ideas plz
indrajit

------------------------------------------------------------------------------------------------------------------
Indrajit

| indrajitbarve@gmail.com | indar_indar2005@yahoo.co.in .
0 Kudos
Message 7 of 7
(2,773 Views)