01-13-2009 08:39 PM
Hi ppl, need help!
I have a simple vi that constantly acquire data and displays in a graph/chart (just to view in runtime). The expt runs for 14 days.
1) how do i time the VI it to run for 14 days? and
2) I need to be able to write the constantly acquiring data to a spreadsheet at regular intervals like, only 30 secs of data every 8 hrs for 14 days (without express vi's) in order not to flood my harddisk writing 14days of data
3) also I need to be able to write data to spreadsheet in between the above specified intervals manually while VI is running , like , i can select 45 seconds of data at that instance and then write to spreadsheet.
4) each data entry (30 sec of data) should be seperated/spaced and have a header that shows the date+time info at which it was acquired and also how can i make the spreadsheet to have the date+time on each value that is on the spreadsheet
would be greatly thankful to you
thanks a ton
freemason
01-13-2009 09:21 PM
Here are some suggested ways to handle each problem:
1) Take the current date/time and add 14 days, use a while loop to run the measurements and display, stop looping when the current date/time is equal to the calculated end date/time
2) Inside the while loop use a "Delay (ms)" VI and wire it to a control or constant to set it up for 30secs (or whatever you want)
3) Need you to clarify this part a little. My recommendation is to right data at every interval
4) Use a "Write to Spreedsheet File.vi" VI to write each row. This VI takes an array of your data. The first element in the array can be a timestamp.
01-13-2009 09:46 PM
thanks joshjack,
i got the 1) ans
2) using a delay inside while loop will acquires data at those multiples ( lets say 5 ms) continously for 14 days and just display on a front panel so that i can look what's happeneing that is fine, but my main aim is to write only those 30sec of data every 8hrs until the end of expt to a spread sheet while it acquires nonstops ( only the writing to file part has to be timed)
3) while the writing to file part at above said intervals is happening silently behind scenes, i still need to be able to poke into vi and write some random data (ex:45 secs) whenever i wish and save them as seperate files
01-13-2009 09:53 PM
I was thinking that maybe a case structure might do the job... If you have a case structure, which is linked to a boolean control (i.e. T/F), then, when the button is not pressed, (i.e. False), the false case should be empty (the inside of the case structure when set to false should be empty). When the button is pressed (i.e. set to true), the true case should have a write to file command.
01-13-2009 11:09 PM - edited 01-13-2009 11:16 PM
For the data recording use a case structure around what you want to happen every thirty seconds. Use the express VI timer (im not sure if thats the actual name but its in the timing submenu of the function palette) which has the option to set a count down time. Set that to 30 seconds, set reset to true, and wire it to the case structure. Whenever the 30 seconds is up, your case structure will be true and the data recording inside it will run.
heres a picture of the express VI so you know what to look for. Just add the 30 secondsof data to an array outside the case structure, then have it write to spreadsheet file inside the case structure and it will write the 30 seconds of data at once.
Question though, how frequently are you recording the data during the 30 second interval? Every 125 ms every 5 seconds, every 15 seconds etc before writing to your file? You should have some sort of time delay in your loop so it doesn't become greedy
01-13-2009 11:19 PM
01-14-2009 09:29 AM
Is the attached what you are looking for?
You will need to do something so your shift registers dont fill up if you are taking data that frequently for 14 days.
01-14-2009 01:08 PM
thank u so much
im working on it and few different examples in other threads,
will ping u in a while
thanks
01-14-2009 01:26 PM
01-14-2009 08:24 PM
this works, but i need something like this
+__________________+___________________+_________________+............................................14 days
0 8hrs 8 8hrs 16 8hrs 24
|30sec| |30sec| |30sec| |30sec|
every 8hrs i need to able to write up 30secs of data and continue the operation until the end of expt (14 days)
I was trying with 2 elapsed time vis, one countsdown 8hrs ,when elapses it should trigger another 30 sec timer which will enable those 30s of of writing and continue again for 8hrs.( it should not stop, it should reset again and wait for the 8hr timer to set it) but i am very much stuck with these timers,
any help would be appreciated