1/4/2023 1:57 PM | |
Joined: 4/25/2011 Last visit: 8/6/2024 Posts: 128 Rating:
|
Dear All, you can use code given in below link to log S7-1200/1500 data in MS SQL using Python script which is very fast and compact in size and the best thing you don't need WinCC or any other SCADA for data logging. https://s7-1200-data-in-sql.blogspot.com/2022/12/import-pyodbc-import-snap7-from-snap7.html Steps:- 1. Download & Install python https://www.python.org/downloads/ 2. Install Snap7 library using "pip install python-snap7" command in CMD prompt. 3. Make a DB & Table in MS SQL. |
Naveen Paliwal |
|
This contribution was helpful to
1 thankful Users |
1/4/2023 4:29 PM | |
Joined: 7/7/2010 Last visit: 8/23/2024 Posts: 15109 Rating:
|
What is the maximum useful logging rate (in Hz)? 100?
|
science guy |
|
1/5/2023 12:09 PM | |
Joined: 4/25/2011 Last visit: 8/6/2024 Posts: 128 Rating:
|
1 Hz is tested for 50 tags (any specific data is not available) which is generally not required in most of the cases. Normally we use 1 minute logging cycle maximum.
|
Naveen Paliwal |
|
1/5/2023 3:03 PM | |
Joined: 7/7/2010 Last visit: 8/23/2024 Posts: 15109 Rating:
|
We have logged data at 5000 Hz using UDP to a PC application accepting the data (could be written in python since it's just a data blob). Only thing is that there's no flexibility of requesting different data points at any time. It's always the same predefined data all the time. The limit for s7-1200 is ~100 Hz which is faster than the s7-1200 analog I/O (typically) updates, so not matter. In a slightly larger application, ~50 Hz is optimal as it provides no errors: no missed, stacked or poorly timed data. Something to consider should you need high speed logging for future applications. FYI, UDP only works (reliably) when the PN cable goes directly from the PLC to the PC and has no other computer traffic to deal with. We use a 2nd LAN adapter on PCs strictly for the control network and only for a single PLC. That isolates all the business traffic and keeps the PLC from having to ignore lots of useless requests.
|
science guy |
|
This contribution was helpful to
1 thankful Users |
1/17/2024 3:51 PM | |
Joined: 3/14/2023 Last visit: 8/15/2024 Posts: 5 Rating:
|
I will follow your advise and try direct communication between DB and SQL! Thanks!!! |
Follow us on