05-24-2014 04:01 AM
Hello Folk,
I have been facing an unexpected issue with file save in RT. I acquire data at rate of 1ms and write it down in TDMS file.
The issue is during writing if RT power goes down the syste does not save data. I do not have any issue with coding it works fine till RT is powered On.
For an example, Lets say I planned to acquire data for 50 seconds however before this 50 seconds if RT goes down that leads to file with no data. Now if RT runs for this 50 seconds then it is capable of saving data.
what issue could be with this ?
your help will be truly appreciated.
05-24-2014 06:19 AM
Be sure to be saving data while acquiring, and not only at the end of acquisition.
You can try reducing the TDMS buffer size: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/setting_tdms_buffersize/
The best would be to give a look to your code to understand what's happening.
Regards,
Marco
05-24-2014 07:02 AM
@MarcoMauri wrote:
Be sure to be saving data while acquiring, and not only at the end of acquisition.
You can try reducing the TDMS buffer size: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/setting_tdms_buffersize/
The best would be to give a look to your code to understand what's happening.
Regards,
Marco
Do you mean to say I need to save file after each bunch I write into file?
Is there such option of saving file for TDMS?
05-24-2014 09:11 AM
I was trying to figure out if you were calling "TDMS write" vi only after the 50s of acquisition 🙂
You can give a try calling "TDMS Flush" from time to time to actually save data to disk....
Marco
05-25-2014 02:20 PM
As was said, it would help a lot if you could show us some of your code that exhibits the issue you are seeing. It could be a simple fix based on what your code looks like.
05-27-2014 06:16 AM
No I do not call TDMS write vi after 50 ms. I do call it every second.
@MarcoMauri wrote:
I was trying to figure out if you were calling "TDMS write" vi only after the 50s of acquisition 🙂
You can give a try calling "TDMS Flush" from time to time to actually save data to disk....
Marco
05-27-2014 07:10 AM
Hiii,
Please find part of code in image here.
@crossrulz wrote:
As was said, it would help a lot if you could show us some of your code that exhibits the issue you are seeing. It could be a simple fix based on what your code looks like.
05-27-2014 07:20 AM
Did you try placing "TDMS Flush" just after the writing?
Does it make any difference?
Regards,
Marco
05-27-2014 07:25 AM
Where is that File Ref coming from? I don't see where you open the file. Nor do I see where you are closing it.
It also concerns me that you are passing the reference to two different places. I can't see what is happening in your subVI, but that is a potential issue.
You should be using the "Not a Number/Path/Refnum?" function to check to see if your file reference is valid.
Your loops run forever. You should have a way to gracefully shut down your VIs instead of just cutting power.
05-27-2014 11:35 PM - edited 05-27-2014 11:42 PM
Yes I tried but It dint make any difference.
@MarcoMauri wrote:
Did you try placing "TDMS Flush" just after the writing?
Does it make any difference?
Regards,
Marco