Functions
Programs are created in logiccloud via the project tree. Within the node POUs you can create a new function. To do this, right-click or go to the icon with the three dots and select Add POU*, assign a name, select as type Function and as language Structured Text (ST). The structure is created automatically.
FUNCTION name (* optional_begin *) : data-type (* optional_end *)
(* optional: declaration of variables *)
(* optional: body of function *)
END_FUNCTIONCalling a function
Section titled “Calling a function”Functions can be called with or without parameters.
Function1();
Function2(INPUT_1:=abc, INPUT_2:=30, OUTPUT => result)Specific logiccloud functions
Section titled “Specific logiccloud functions”Read out the date and time of the device
Section titled “Read out the date and time of the device”// UTC date and timeSYS_UTC_DATE_TIME();VAR_OUTPUT UTC: DATE_AND_TIME;END_VAR
UTC := SYS_UTC_DATE_TIME();// Output: 2023-09-05T14:48:00.0000