Download HTTP_Client_Example.zip
With the function block "HTTP Client", http requests, as well as the resulting responses,
can be exchanged between a CODESYS controller and a web server.
The CODESYS software package includes a library with a function block for communicating
with a web server via HTTP.
The HTTP header of a request can be extended without any restrictions. The library is included
as source code in the CODESYS package.
Function block "HTTPClient"
Function block for sending http requests. The sample project HTTPClient.project
illustrates
how this function block is used.
Function "URLDecoder"
Function for coding and decoding URLs (percent encoding).
System requirements and restrictions | Info |
---|---|
Programming System | CODESYS Development System Version 3.5.14.0 or higher |
Runtime System | CODESYS Control Version 3.5.14.0 |
Required Accessories | - |
I have been using http client successfully for approximately 12 months, however in recent weeks I have begun to get TCP_INIT_ERROR when attempting to communicate. The only resolution seems to be power cycling and then the connection begins to work again for a time. I am not aware of any changes to code or libraries between working ok and now. Cold reset does not resolve, only power cycle.
So it seems the error from NBS.TCP_Client is 6002 which I think is invalid_addr
However the address is the same when working and not working?