<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.15">
  <POU Name="MAIN" Id="{41922041-c288-47bf-8cbe-46abb8ecd6a5}" SpecialFunc="None">
    <Declaration><![CDATA[PROGRAM MAIN
VAR
	bGet, bGetQuery, bPostJson, bPostXml, bPut, bDelete : BOOL;

	fbHttpClient 					: FB_IotHttpClient :=(
//															sHostName := '192.168.8.51', // or 'localhost'
															bKeepAlive:=TRUE, tConnectionTimeout:=T#10S);
	fbHttpGet						: FB_TestHTTP_Get;
	fbHttpGetQuery					: FB_TestHTTP_Get_Query;
	fbHttpPostJson					: FB_TestHTTP_Post_Json;
	fbHttpPostXml					: FB_TestHTTP_Post_Xml;
	fbHttpPut						: FB_TestHTTP_Put;
	fbHttpDelete					: FB_TestHTTP_Delete;
	
	ton1							: TON;
	bCyclic							: BOOL := FALSE;
	tCyclicTime						: TIME := T#100MS;
	bToggle							: BOOL;
	eHttpCyclic						: E_HTTP_Cyclic := E_HTTP_Cyclic.Idle;
END_VAR
]]></Declaration>
    <Implementation>
      <ST><![CDATA[
IF NOT fbHttpClient.bConfigured THEN 
	fbHttpClient.nHostPort:= 19090;
	fbHttpClient.stTLS.bNoServerCertCheck:=FALSE;
END_IF

IF fbHttpClient.bConfigured THEN 
	fbHttpGet(bSend:= bGet, fbClient:= fbHttpClient);
	fbHttpGetQuery(bSend:= bGetQuery, fbClient:= fbHttpClient);
	fbHttpPostJson(bSend:= bPostJson, fbClient:= fbHttpClient);
	fbHttpPostXml(bSend:= bPostXml, fbClient:= fbHttpClient);
	fbHttpPut(bSend:= bPut, fbClient:= fbHttpClient);
	fbHttpDelete(bSend:= bDelete, fbClient:= fbHttpClient);
END_IF

fbHttpClient.Execute();

A_Cyclic();
]]></ST>
    </Implementation>
    <Action Name="A_Cyclic" Id="{6dda28a7-696e-4841-aabd-c80f12776323}">
      <Implementation>
        <ST><![CDATA[
IF bCyclic THEN
	ton1(IN:= NOT ton1.Q , PT:=tCyclicTime , Q=> , ET=> );
	bToggle:= FALSE;
	IF ton1.Q THEN
		bToggle:= TRUE;
	END_IF
END_IF

CASE eHttpCyclic OF
	
E_HTTP_Cyclic.Idle:
	;
	
E_HTTP_Cyclic.GET:
	bGet := bToggle;
	
E_HTTP_Cyclic.GET_Query:
	bGetQuery := bToggle;
	
E_HTTP_Cyclic.POST:
	;
	
E_HTTP_Cyclic.POST_Json:
	bPostJson := bToggle;
	
E_HTTP_Cyclic.POST_Xml:
	bPostXml := bToggle;
	
E_HTTP_Cyclic.PUT:
	bPut := bToggle;
	
E_HTTP_Cyclic.DELETE:
	bDelete := bToggle;
	
END_CASE]]></ST>
      </Implementation>
    </Action>
  </POU>
</TcPlcObject>