Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

ring memory files in the CRD


smile Nov 21, 2022 12:04 PM

Dears,

in a CR1000X logger I have a 16 Mg microSD card and the logger writes small files to it every 5 minutes.

It happens that when a large number of files is reached and/or when there are about 6..7 gigabytes left to fill, therefore about 9 gigabytes of files written, the writing and ftp sending stops.

Formatting the card everything restarts regularly.

To solve this problem but also to limit the number of files that increase too much and unnecessarily, I want to create a ring procedure to always keep the last 3 days, therefore 864 files and, as the logger does, when I reach this limit, it starts deleting the oldest ones. In the hope of being clear, do you have any suggestions?

thank you

Regards

Smile


JDavis Nov 21, 2022 09:57 PM

The instructions you need to use are FileList(), FileTime(), and FileManage().

A problem with that many files is that the array needed for FIleList() will use up quite a bit of RAM. Keeping files names short will let you keep the string length shorter.

Note that the FileTime() instruction uses the Nsec time format. Public.Timestamp can output in the same format. You will need to calculate how many nanoseconds 3 days is.


smile Nov 22, 2022 03:09 PM

many thanks

Log in or register to post/reply in the forum.