Use the sample program to collect data from a weather server.
In this example, we will use the POU "Easy_HTTP_Client". This POU contains all settings required to establish a connection with a weather server.
Prepare and compile the PLC program:
- Make sure that the POU "Easy_HTTP_Client" is the only POU assigned to the program task.
- Replace the value for the parameter appid in the variable sMyCommandToSend with your API key.
- Specify the start address of the g_dutFPI4C_HTTPClient DUT in the global variable list.
The default setting is DT240. (If you kept the default value DT240 on the "HTTP client" page, you do not need to change the address.)
The project is now ready to be compiled and transmitted to the PLC.
- Select , then Compile all... and Download program code and PLC configuration to PLC to transmit the program to the PLC.
Start communication with the weather server and monitor your POU: