S7-1200 HTTP Request

edda

Member
Join Date
Jun 2008
Location
At the office
Posts
100
Hi all!

Would it be possible to make a http request (GET) from a Siemens S7 1200?
I would like to call a web API on a server (port 80) once every minute.

Best Regards

Edmund
 
In addition to the built in protocols, the 1200 supports open socket communication via the t_send/t_recv commands. You can send/receive any tcp/udp data you want, but you need to parse the protocols yourself. There is not a pre-defined block for http get requests, but maybe someone on here has done it before?

The 1200 should definitely be able to support sending/receiving the request once a minute, the trick is writing a block to understand the web API.

I'll also add, for the record, that I'm hoping this is a private web server, and that you are not connecting the PLC directly to the internet. PLC + internet = hackers galore, in case you weren't aware.
 
Last edited:
In addition to the built in protocols, the 1200 supports open socket communication via the t_send/t_recv commands. You can send/receive any tcp/udp data you want, but you need to parse the protocols yourself. There is not a pre-defined block for http get requests, but maybe someone on here has done it before?

The 1200 should definitely be able to support sending/receiving the request once a minute, the trick is writing a block to understand the web API.

I'll also add, for the record, that I'm hoping this is a private web server, and that you are not connecting the PLC directly to the internet. PLC + internet = hackers galore, in case you weren't aware.

Hi mk42.

Thanks for your reply.

I will look in to the t_send/t_revice function, I´ve been doing the same thing with codesys and the use of OSCAT network library, but I have not been able to find some similar library for S7-1200.

So if anyone knows about and premade blocks that exists please let me know :)

The API is a closed internal function, and we are only sending the status of a Digital input into the API.

BR.

Edmund
 

Similar Topics

Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
2
Views
58
Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
0
Views
34
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
6
Views
282
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
99
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
134
Back
Top Bottom