Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTPS Client for Siemens S7

Tags:

https

plc

I've a RESTful HTTP API. Now I would like to send HTTPS requests from my S7 PLC to the API. I've contacted Siemens and they said that they don't have a HTTPS client implementation.

But there is a tcpClient module in the library. And since TCP is the foundation for HTTP over SSL, I wanted to ask if somebody has already implemented a HTTPSClient or if somebody knows where to start?

The API is only via HTTPS accessible to protect the privacy.

like image 343
Tobias Avatar asked Apr 05 '16 08:04

Tobias


2 Answers

The tcpClient only enables you to create a TCP socket and is not meant to provide communication with a HTTP(s) server. The S7 does not have enough processing power to provide full HTTP communication.

One of the options you have is to place a small computer near the PLC and do a conversion to one of the protocols the S7 does support like OPC-Da or write a custom implementation to work with the tcpClient.

Depending on the S7 version you could also use OPC-Ua which is the successor of OPC-Da so you won't have any trouble with dcom. Another benefit of OPC-Ua is that is has build in encryption and can travel trough firewalls.

If you need any further information please let me know.

like image 111
Joost Avatar answered Nov 17 '22 17:11

Joost


Having a tcpClient module enables you creating TCP socket for communicating with PC or other PLC. However, HTTPS is another story: It is the application layer protocol.

PLC programming software, in your case Step 7, are normally designed for implementing control algorithms; data processing is definitely not the strongpoint, though today's PLC hardware should be powerful enough for HTTPS.

I would say if you could get the access to S7 PLC's kernel API (I know Schneider did provide SDK for their Unity platform but I am not sure Siemens), you should be able to write your HTTPS module with C language. However, with IEC61131-5 language is not an option at all.

Regards, Hao

like image 3
Hao Avatar answered Nov 17 '22 17:11

Hao