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.

Archiving data file and deleting it afterwards


JaRay Sep 5, 2012 07:05 PM

I am trying to accomplish something that I have not seen on the forums. Previously, we would poll our CR1000 array every 15-30 minutes depending on the location. We had a service running that would store the data into a sql server database, then archive the data files in an organized fashion via month and date. This kept the data files from getting too large. This service did give us some trouble, so we decided to try out LNDB. For storing the data, we are preferring to use LNDB, however archiving the data is now a problem. Using LNDB we are now polling the loggers every 30 seconds. This is great for us since we need to be close to real time. I started to alter the service to only handle archiving, but then I started to think about what might happen if it tries to archive the data at the same time as being written.

Now I am wondering if it is possible to move the datafile using the CR1000 programming. Doing it this way will allow me to move the data only after the write commands have been completed. Instead of trying to do this every day, I feel like I could get by with just telling to to archive the files once it reaches a certain file size. In CRBasic Editor I see there are functions for FileCopy and FileSize, which I think will let me accomplish the archiving of the data, but this doesn't handle clearing the DataTable to keep the FileSize at a minimum. Do you know of a way I can accomplish this?


Dana Sep 6, 2012 06:29 PM

Take a look at the TableFile instruction. This may do what you want more easily than the file manipulation instructions.

Dana W.

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