Important Announcement: Protecting our Community from Spam Events
Dear Members, we apologize for any disruption or inconvenience caused by the
recent spam incidents, and we want to assure you that our dedicated team is
actively investigating each reported instance of spam and implementing robust
measures to mitigate the impact. Learn more on
Spams Mitigation Guidelines
Schneider Electric Community Team
How do we write / read csv file to SD card with M251?
Industry Automation and Control Forum
This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.
While this program is a precursor to the CSV File Writing/Reading Example project available with ME I didn't detect any means of writing to / reading from SDcard.
I noticed mention of using the mass storage "feature?" of ME and in some of the documentation it refers to
accessing the SD card via /sd0 - appropriate since that is the standard linux folder name for SDcard
However this Mass Storage feature appears to be purely manual - at least I see no means to integrate it into
the running PLC environment. (As an aside, the behaviour of that tool, in terms of upload is just silly. It pays
no heed at all to the specified source folder and just randomly grabs a few of the system folders)
When I attempted to prepend /sd0/ to the file path in the CSV_ReadWrite example programs, they failed
even though prepending /test did result in the file being written in the /test folder as expected. It appears that sd0 is indeed recognized as a special folder - rather than just an ordinary folder - but the
implementation to actually access the device is broken.
While some kind of hack is implemented in the DATALOGGER function which enables the files to be written either to
internal system memory or to SDcard, this hack appears to be a non-standard special-case anomaly... Unfortunately, the DATALOGGER functionality is somewhat gimped up... the file name is static and cannot
be dynamically created - like as yyyymmdd.csv. It is not clear whether it would be possible to use any
functions/utilities to copy the contents of the datalogger file - either because that file would still be open - or
because the functions lack the flexibility to perform such operations
Also the datalogger format, reminiscent of visual BASIC or some other early DOS code wants to be "helpful"
by stuffing in a CSV-mangling continuously updated first line indicating how many lines have been written to the file...
so... does anyone have any insights into wrangling / smartening up / working around this 1980's era stuff ?