S7-1200 to SQL

Today Siemens released an application example of how to connect to a MS SQL server with a S7-1500.
I haven't tested it, but from what I've seen I think it may also run on a S7-1200 with minor modifications:

https://support.industry.siemens.com/cs/document/109779336


Good find, sir! note on 1200 usage, from the documentation:
Under the following conditions, this module is also functional with an S7 1200 from firmware V4.4 or higher:

Do not use the archive functionality

Comment out program line 386 of the "LSql_Microsoft" block. To do this, open the block and click on "Edit type". Now find program line 386 with the "WriteToArrayDB" instruction and comment it out.
 
I will also thank you for this link. I've been up to trying to get s7-1200 message MQTT to AWS IoT and then Lambda function to MySQL RDS. Now maybe I can try with s7-1200 straight to the AWS RDS
 
I will also thank you for this link. I've been up to trying to get s7-1200 message MQTT to AWS IoT and then Lambda function to MySQL RDS. Now maybe I can try with s7-1200 straight to the AWS RDS


It looks like the Siemens app note is specifically for MS SQL. It is implementing a more or less proprietary protocol; I haven't been able to find any other DB systems that support it (except Sybase, which MSSQL is based on).
 
It looks like the Siemens app note is specifically for MS SQL. It is implementing a more or less proprietary protocol; I haven't been able to find any other DB systems that support it (except Sybase, which MSSQL is based on).

On AWS RDB I can create a public ms SQL database running on the cloud, I was hoping I could access is with this block over internet, but I'm probably wrong 😊
 
On AWS RDB I can create a public ms SQL database running on the cloud, I was hoping I could access is with this block over internet, but I'm probably wrong 😊


Oh, you said MySQL in the first mesage, which was what I was addressing.


In Theory, I don't know why you wouldn't be able to reach a DB in the cloud, but in Practice I've heard that getting the certificates set up correctly to do it in a secure way (TLS) can be challenging.
 
Oh, you said MySQL in the first mesage, which was what I was addressing.


In Theory, I don't know why you wouldn't be able to reach a DB in the cloud, but in Practice I've heard that getting the certificates set up correctly to do it in a secure way (TLS) can be challenging.

I was not clear in my post

I dont think you need certificates to the AWS RDS. I have set up s7-1200 to the AWS IoT core module and there you have to have certificates, but after many hours I got it working.

So now on to the RDS 😊
 
I have setup a project that is working with the function block in the application with a s7-1200 writing to MsSQL in Amazon webservices.

Only thing is that I had to comment out the whole TRCV block in the FB, that is not stated to do so in the manual. Don't know what purpose the TRCV block serves though.

Hopefully this will help someone not spending several hours figuring this out...

/Tim
 

Similar Topics

Hi, Today I have a s7-1200 with comfort panel logging to excel from vbscript. The thing my customer want is to logg values to SQL instead of...
Replies
17
Views
4,943
Hi all, I have a client wanting to implement our system in his big data acquisition system. I have looked online, and I see there are several...
Replies
2
Views
3,178
Hey there! I've got some questions/problems with the tia portal v11 and the PLC s7-1200. I don't know how to log my data into a mysql database...
Replies
5
Views
11,468
Hi FYI, I am new here ;o), first an explenation: I have a Micrologix 1200 PLC, a serial to Ethernet adapter (from AB), a Endress + Hauser...
Replies
14
Views
6,351
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
2
Views
36
Back
Top Bottom