We need to build up an application where we are logging data at a very high frequency. Our customer requests a frequency of 10ms, output should be a csv file. Even if we combine 100 samples, I still need to write every second towards the memory. To avoid damage to the flash memory, I followed this description: https://www.plcnext-community.net/en/hn-makers-blog/326-creating-a-ram-disk-in-the-axc-f-2152.html I know that we will lose all data when the system reboots, but that is not an issue in this case. Are there any other technical issues which I need to consider?
Hello Sven, I would like to recommend you to use the DataLogger Library in our PLCnext Store (https://www.plcnextstore.com/#/347). The data will be stored in .csv format and the frequency of 10ms should be ensured. The second way is to use the FW-DataLogger-Service in this case the data will be stored in SQLite database and can be exportet to .csv file e.g. via DB Browser for SQLite. The data can be stored on SD Card or RAM-Memory depends on DL-Configuration. Please see the following description: https://www.plcnext.help/te/Service_Components/DataLogger/DataLogger_concept.htm If you have additional questions, please don’t hesitate to ask! Best Regards Eduard
Hello Eduard, I have tested the datalogger library from the PLCnext Store and this seems to be the right solution. But it is necessary to keep the file always open (via setting bConf). Otherwise, I am losing data. Current cycletime is 2 ms. Each 5 cycles, I do a log request.
Only question for me remains the wear leveling on the SD card. Is the following reasoning correct? We are continuously writing to the flash memory. Once the sftp transfer is done, we may delete the file again.
I was thinking about 100 files in a ringbuffer, depending on the size of one file. We need to write about 250 bytes per 10 ms
= 24,41 kB per second (x 100)
= 1,43 MB per minute (x 60)
= 85,83 MB per hour (x 60)
= 2,011 GB per day (x 24)
= 734 GB per year (x 365) Minimum amount of write cycles for each cell on a 2GB card: 734 / 2 = 367 per year
In practice it will be a higher value because there is no 2GB available on the card. How many write cycles (for each cell or block) are allowed on a SD card?
Hello Sven,
The information from the manufacturer is contained in the table below. The values are given in terabytes of written. Please note, we only use the 4 and 8 GB cards from the manufacturer listed below.
~Eduard
