MVP 2021 Ausman Posted May 29, 2015 MVP 2021 Report Share Posted May 29, 2015 Hi again all, V130. I am having trouble writing a different name for each consecutive save of a complete data table to the SD card. I want to do the write as a new file, not an append. I have a large logging data table that is written to every minute, 24/7. I am then running "Write Data Table to SD" once every 24 hours, so that I will end up with just over 2 months worth of individually named logs on the SD before it reaches the 64 limit, alleviating the current need for me to log on every day to upload the table direct. I can thus do a remote upload of all of them every 2 months, and then clear things out ready for the next lot. I transact the write ok, but I cannot get a new, separate file being written, it is always overwriting the old one. I can do an append but this is not what I want. I want to label each new udt save on the SD card with the date/month. I am storing SI32 into an MI. I select DT (1) as the SD folder and the MI as .udt file name. I suspect that the problem is either: a). the sometimes strange ways RTC info is derived/stored in PLCs, or . is related to the advice "Note that if the name comes from an MI, the function copies a vector 8 bytes long, or until it finds a 'null' character." Perhaps things are reaching a null character before any actual numbers come up, and so the write is being told to go to the same name (no name?) so it overwrites the existing. Given the varying nature of how the numbers in SI32 work for different dates, I am scratching my head a bit as to how to get this to work. No doubt the solution is really simple, but my brain is stuck in a "dumbo" loop which we all get from time to time, and emerge from smacking our head going stoopid, stoopid, stoopid! All suggestions gratefully received! cheers, Aus Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.