Siemens PLC - Data Log Values to CSV

Good Morning :slight_smile:

I'm using a Siemens PLC to data log a process of recording pressure every 10ms. The software currently works by waiting for the pressure to increase >0.1 PSI, starts the in-built Siemens data logging process, then stores this data locally on the PLC memory card as a CSV. Works great, but I'm struggling to get access to these CSV files, without manually accessing the Siemens webserver, by typing in the PLC I.P. address and going to the data log folder to save files.

I've tried a few things in Node-Red, but am a bit stuck... Could someone possibly advise with one of the following please?

Option 1. Using Node-Red to automatically access the Siemens PLC webserver, and pull CSV files from the PLC SD card and place into a folder. (e.g. C://Users/Datalogs/)
Option 2. Using Node-Red to read the values of a full data block, rather than individual variables. E.g. I complete a data log, save these values in a data block, then tell Node-Red to pull all of the data in that data block and push it out in a CSV. Keeping in mind that the data block will be of various sizes, as not all tests are the same length.
Option 3. Do the data logging process in Node-Red, and just have a high sample rate from one variable, record this in a CSV with a header, and save this in a folder with a unique CSV file name.

I've given this a good go, but seem to be struggling with Web Server access, and although I can access the data block variables, I would need to type out every data block variable which could be around 600 variables...

Thanks in advance!

  • Automation Dad

Does the Siemens web server have security?

Open the browsers dev tools>network tab, find the query that gets you the data, right click it and copy as curl (bash) & show us

Depending on which S7 node you are using you would need to setup a tag/tags upfront (not terribly dynamic). There is one S7 node I've previously used that permits freeform access - i.e. let's you specify the address at runtime and can query arrays of data (not just single addresses)

This is not a good idea for several reasons:

  • flooding the network
  • hammering the PLC
  • Unless you could read every address at once, data would be inconsistent (i.e. read from different PLC scans
  • You will be hard pushed to read 1 address across the network in 10ms let alone 600.

Hi Steve,

Does the Siemens web server have security?

It does. There is a username and password credentials, as well as certificates for the web server site.

Depending on which S7 node you are using you would need to setup a tag/tags upfront (not terribly dynamic). There is one S7 node I've previously used that permits freeform access - i.e. let's you specify the address at runtime and can query arrays of data (not just single addresses)

I've tried a few, from the normal S7-IN on the conrtib-s7 node, to the OPC server, but they are all wanting individual variables.

This is not a good idea for several reasons:

Understood. It works well within the PLC and doesn't cause issues, but I appreciate that it may cause issues if I'm doing this over a network.

I have found a potential solution though, using the Simatic Automation Tool to run a .exe to push files from the webserver with a signal, which I think I can configure. This would also keep a copy of the datalog on the PLC as a backup, if it didn't transfer across properly for some reason. May not need Node Red for this one! :slight_smile:

Link: Process Data Acquisition and Monitoring with the SIMATIC S7-1200 / S7-1500 (Data L... - ID: 64396156 - Industry Support Siemens

Thanks for your help!

  • Automation Dad

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.