A forum addressing machine automation solutions for the complete machine lifecycle. Including offers like Machine Advisor, Modicon PLC/PacDrive, Lexium or Preventa. Discuss and share knowledge on offers relating to cloud-based service platforms, machine localization and monitoring, industrial operations control, motion products as well as safety function!
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-05-1901:17 PM
M241 datalogging to datestamped .CSV files
We are still having problems working out a suitable datalogging solution.
We want to generate daily (or potentially monthly) datestamped.CSV files with the operating variables written onto the sdcard. This was simple and straightforward to implement on another PLC platform (which would even automatically create the variable-name header line for each new file and would automatically take care of formatting the log-string)
One mechanism is the out of the box datalogging - which enables writing directly to SD card. The problem with that is there is a fixed logfile name with a fixed number of records. (plus there is a goofy extraneous initial record which indicates how many records in the file which would have to be ignored/filtered out) It is not clear whether there is any way to copy the active logfile to a new date-stamped file. It appears that the only possible way to access the SDcard is by using scripts problems with which I will post in a separate case
Is that datalog file considered to be open at all times and hence potentially not copyable ? once the file has been copied can the file be cleared ? Can the datalogging be turned off under program control, the scripts to rename the logfile executed and the datalogging turned back on again all during a continuous system operation ?
Another mechanism is to use the CSV File Write function, which due to design defects cannot access the SDcard directly. I envision an approach in which the properly formatted/date-stamped.CSV files are written to system memory and then periodically "uploaded" to SDcard under PLC program control.
Another variant would be to transfer the logfiles from system memory to SDcard externally using FTP. Which brings up the question whether any of the Harmony HMIST HMIs have the capacity to do FTP file transfers... Rummaging around in Terminal "Expert" provides no apparent clues... Presumeably one can write a script to do this but the objects to use are not apparent. These will be stand alone systems.
One question is just how much storage space is available on the internal system memory ? Why is it that when making an ftp connection, I can create the missing /sd0 folder and then the contents of the SDcard are immediately available, while in Machine Expert file manager, when I create the folder /sd0 the folder remains empty I suspect that under the file manager, the root is /usr not / and hence /sd0 is not accessible.
Any ideas/suggestions/definitive answers to the questions/sample programs with all of this fully implemented would be most welcome.