11-13-2008 06:08 PM
Hi,
i am trying to measure the temperatue on every 30 sec and write it in a file. which i have done. But i am stuck with one problem can you please give me some clue.
After every 5 min the data file will close and creat a new file and will record new 10 data then it will close and creat a new file. file name will be automatic. like i have given file name kirit. second one will be kirit1, kirit2.......
i have attached my work here. thanks in advace.
11-14-2008 02:00 AM
Hi data file...,
you should run your more often. If you press the stop button at the beginning, you habe to wait 30 sec, until the loop will stop. You can use 1 sec and count the iterations, in every 30 iteration you write the data to your file.
Hope it helps.
Mike
11-14-2008 06:36 AM
Hello,
I hope you are doing fine. I am confused with your post. Is the problem is that the file closes after every 5 minutes or is it your aim that you want to close the file after every 5 minutes , reopen it automatically and then give it a new name ?
Any way by looking at your code , it seems that even if you press the stop button it has to wait 30 seconds which is not a good programming practice. I have modified your VI so that it takes temperature reading after every 30 seconds and when you press a stop button it stops after a second.
Best regards,
11-14-2008 10:10 AM
Hi
Thanks Nisar and Mike for your post.
Nisar,
i was not able to open your file beacuse i am using here 8.5 . can you please send me a image . My aim is to record data in every 30 sec for 5 min . After 5 min it will close that file and will create a new file and record data for next 5min. it will continue like this if i press stop it will stop immidiately. Am i clear Please let me know .
with thanks
kirit.
11-14-2008 11:14 AM
Hi,
Here is the 8.5 version. This will help you imediatly stop the code. We can look more into it on Monday.
Thanks,
11-17-2008 10:19 AM
Hi Nisar,
Thanks for your 8.5 version it work perfect now. can you give me some clue about the file close stuff.
My aim is to record data in every 30 sec for 5 min . After 5 min it will close that file and will create a new file and record data for next 5min. it will continue like this if i press stop it will stop immidiately.
thanks again
Kirit
11-18-2008 10:53 AM
Hey data file,
I made a VI for you that blinks a light every 30 seconds and changes a filepath every 5 minutes. I did not put in the actual measurements or write to file, but I thought it would be enough to get you going. Basically the best way I can think to do this is to use shift registers to keep track of the iterations, then use case structures at your desired iterations (30 and 300 seconds). Hope this helps.
11-18-2008 04:45 PM
Hi,
thanks chris for your help. i was trying to do that with shift register . But an error said Missing Assignment to tunnel . iam not sure where i have done mistake. i have uploaded the file, please have a look.
thanks agian
Kirit
11-18-2008 08:27 PM
Hello Kirit,
You need to wire a value to an output tunnel for every case in the case structure. In your VI, you did not have anything wired to the output tunnels for the 'False' case in the case structures. This is why you received the 'missing assignment to tunnel' error.
Also, I noticed that your VI currently would not save the data to a new file every 5 minutes, as no new file path was being wired into the 'Write to text file' VI every 300 seconds Therefore, the inner case structure was not effective at all. I have attached a modified version of your VI to this post that should give you an idea as to how it can be done.
I hope this helps!
11-19-2008 11:19 AM
Hi vivek,
thanks it worked but it was not upto my desire as i wanted to close the output in every 5 min and create a new one. i have attached the output of that file first one. it create in the same file.
then i modified the VI and can have my desire file close and open a new one but i think i have not done something smart programming. Even it has a problem first file store more data. but the rest file store one data and close.
Do you think i need to avoid shift register to avoid that complicacy.
with thanks
Kirit