Skip to content

Standard functions

logiccloud provides a library of standard functions that can be called from any Structured Text body. Functions are stateless: they take their inputs, compute a result, and return — there is no instance to declare (unlike function blocks).

This reference is split by category. Each category page lists every function in that group with its signature and a short usage example.

result := SQRT(area); // math
both := AND(statusA, statusB); // bit-string
chosen := SEL(useBackup, primary, backup); // selection
pos := FIND(line, 'ERROR'); // string
nowUtc := SYS_UTC_DATE_TIME(); // date/time

In the category tables the generic parameter types describe the family of concrete types accepted:

Generic typeAccepts
ANYAny type
ANY_NUMSINT…ULINT, REAL, LREAL
ANY_REALREAL, LREAL
ANY_INTSINT, INT, DINT, LINT, USINT, UINT, UDINT, ULINT
ANY_BITBOOL, BYTE, WORD, DWORD, LWORD
ANY_ELEMENTARYAny elementary (non-derived) type
ANY_STRINGSTRING, WSTRING
ANY_CHARSSTRING, WSTRING, CHAR, WCHAR

Conversion between data types (e.g. INT_TO_REAL) is provided by a large, rule-generated family of functions documented on the conversion page and, for the naming rules and type set, on the separate type conversion page.

FunctionParametersReturns / outputs
RPC_CALLTOPIC : STRING, COMMAND : STRING, PARAMS : ANY, TIMEOUT : TIME, FALLBACK_VALUE : ANY, ASYNC : BOOLreturns ANY; out RESULT : INT

RPC_CALL is a logiccloud extension for invoking a remote service (for example a REST-RPC connection) over the platform’s messaging layer. It returns the remote result (typed from FALLBACK_VALUE) and reports an INT status through its RESULT output. See the dedicated RPC_CALL reference for the full signature, sync/async semantics, result-code table and a worked example.