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.

Scheduled collection every X seconds and new filename every X hours

gcauble Apr 8, 2023 01:54 PM

I have a unique data retreival requirement where I want to pull data every 10 seconds from my CR6 but want a new filename for that data to be created every hour. I'll explain my current setup below but am open to making major configuration changes to get a more robust solution.

Currently I pull data from my CR6 every second for a real time display. The data from the CR6 is pulled via a scheduled collection in loggernet. I would like to continue collecting every X seconds but want a new filename created every hour (or an arbitrary time interval).

An example of the solution for a file with arbitrary timestamp ClimaVUE50_yyyymmdd-HHMMSS:

ClimaVUE50_20220408-130000.dat (is appended to every X seconds)

ClimaVUE50_20220408-140000.dat (is created an hour after the first and appended to every X seconds)

This would continue until the scheduled collection is stopped (or the program is stopped if the only solution for this is via CRBasic).

Any advice would be appreciated!

JDavis Apr 11, 2023 09:01 PM

Not for the faint of heart, but Loggernet can be controlled with a command line API. Data collection interval is a setting that can be altered.

Looking through the Cora Script help, I do not see the file name as editable with the command line. If you let the most recent file be a static name, just rename the file when it is full of the interval you want. Next collection will create a new file with the static name.

gcauble Apr 18, 2023 01:04 AM

I would use an external program to monitor when the file has reached the data interval and rename?

Would all of this be easier to automate by setting up my datalogger code to change file names every X interval and have it FTP files every X interval?

smile Apr 19, 2023 08:31 AM


I hope that have understood your requirement correctly.

Have you never seen the potential of split?

You could schedule a procedure with split that uses the file where the data arrives every x seconds and generate a new file every hour. Few use split but a really powerful application. It can be scheduled and has a lot of features. Read some help and give it a try.


JDavis Apr 19, 2023 07:52 PM

Yes, FTP to send separate files is a possibility.

Split can leave the original dat file intact and output a new file based on an interval. If you want headers on the new files, there is a bit of extra work to do.

TaskMaster in Loggernet can be used to trigger scheduled tasks, like run a script file.

oletaschmeler Mar 25, 2024 04:51 AM

I couldn't find any mention of being able to change the file name from the command line in the Cora Script documentation. If you set the most recent file to have a static name, you may simply rename it when the interval you choose is filled. A new file will be created with the static name in the next collection. gorilla tag

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