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

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
61
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
114
commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
87
Hi, I have a 1214 on ip 192.168.0.100. This is connected to other modules through a switch on same network. I need to connect this to a company...
Replies
1
Views
141
Hi. I’m trying to upload program from existing PLC S7-1200. Create new project in TIA v15.1 then upload. After upload successfully, go online but...
Replies
5
Views
206
Back
Top Bottom