OAuth1WebClient (FB) ¶ FUNCTION_BLOCK OAuth1WebClient Function block to a send an oAuth1 request. InOut: Scope Name Type Initial Comment Input xExecute BOOL Rising edge: Send request udiTimeOut UDINT Timeout in micro seconds sURL STRING(1024) URL of the web server eRequestType REQUEST_TYPE REQUEST_TYPE.GET Type of the request: POST or GET eContentType CONTENT_TYPE CONTENT_TYPE.APPLICATION_FORM HTTP Content-Type of the request pwsAdditionalHeader POINTER TO WSTRING Additional HTTP header pwsPostValue POINTER TO WSTRING Post parameter xCloseConnection BOOL FALSE Close the connection after each request. sOAuthConsumerKey STRING(255) OAuth1: Consumer key sOAuthToken STRING(255) OAuth1: Token sConsumerSecret STRING(255) OAuth1: Consumer secret sOAuthTokenSecret STRING(255) OAuth1: Token secret itfTLSContext NBS.ITLSContext 0 Encapsulates all the data neccecray to handle encrypted tcp connections Static initialization, as shown in the following code snippet. VAR commonName : STRING := 'MyRrasPi' ; ciCertInfo : NBS.CERT_INFO := ( psInfo := ADR ( commonName ), udiSize := LEN ( commonName )); myTLSContext : NBS.TLSContext := ( ePurpose := NBS.PURPOSE.CLIENT_SIDE , sUseCaseName := 'NBSTest' , sTLSVersion := '1.3' , ciCertInfo := ciCertInfo , udiVerificationMode := 2 ); END_VAR itfAsyncProperty NBS.IAsyncProperty 0 Runs the connect process in a own background task, usage see library Net Base Services Output xDone BOOL xBusy BOOL xError BOOL eError ERROR Current error state httpResult HttpResult The result of the request
OAuth2WebClient (FB) ¶ FUNCTION_BLOCK OAuth2WebClient Function block to a send a request via 2 legged OAuth2 authentication. Supported request types (flows): client_credentials and password. InOut: Scope Name Type Initial Comment Input xExecute BOOL Rising edge: Send request udiTimeOut UDINT Timeout in micro seconds sURL STRING(1024) URL of the web server (resource server) eRequestType REQUEST_TYPE REQUEST_TYPE.GET Type of the request: POST or GET eContentType CONTENT_TYPE CONTENT_TYPE.APPLICATION_FORM HTTP Content-Type of the request pwsAdditionalHeader POINTER TO WSTRING Additional HTTP header pwsPostValue POINTER TO WSTRING Post parameter sAuthorizationServerURL STRING(1024) URL of authorization server pwsAdditionalAuthenticationHeader POINTER TO WSTRING Additional Auth HTTP header itfOAuth2Credentials IOAuth2Credentials OAuth2 credentials xCloseConnection BOOL FALSE Close the connection after each request. itfTLSContext NBS.ITLSContext 0 Encapsulates all the data neccecray to handle encrypted tcp connections Static initialization, as shown in the following code snippet. VAR commonName : STRING := 'MyRrasPi' ; ciCertInfo : NBS.CERT_INFO := ( psInfo := ADR ( commonName ), udiSize := LEN ( commonName )); myTLSContext : NBS.TLSContext := ( ePurpose := NBS.PURPOSE.CLIENT_SIDE , sUseCaseName := 'NBSTest' , sTLSVersion := '1.3' , ciCertInfo := ciCertInfo , udiVerificationMode := 2 ); END_VAR itfAsyncProperty NBS.IAsyncProperty 0 Runs the connect process in a own background task, usage see library Net Base Services Output xDone BOOL xBusy BOOL xError BOOL eError ERROR Current error state httpResult HttpResult The result of the request Methods: ResetToken Structure: ResetToken (Method)
WebClient (FB) ¶ FUNCTION_BLOCK WebClient Function block to send http and https requests. InOut: Scope Name Type Initial Comment Input xExecute BOOL Rising edge: Send request udiTimeOut UDINT Timeout in micro seconds sURL STRING(1024) URL of the web server eRequestType REQUEST_TYPE REQUEST_TYPE.GET Type of the request: POST or GET eContentType CONTENT_TYPE CONTENT_TYPE.APPLICATION_FORM HTTP Content-Type of the request pwsAdditionalHeader POINTER TO WSTRING Additional HTTP header pwsPostValue POINTER TO WSTRING Post parameter xCloseConnection BOOL FALSE Close the connection after each request. hCert RTS_IEC_HANDLE RTS_INVALID_HANDLE Handle to a certificate (optional) itfTLSContext NBS.ITLSContext 0 Encapsulates all the data neccecray to handle encrypted tcp connections Static initialization, as shown in the following code snippet. VAR commonName : STRING := 'MyRrasPi' ; ciCertInfo : NBS.CERT_INFO := ( psInfo := ADR ( commonName ), udiSize := LEN ( commonName )); myTLSContext : NBS.TLSContext := ( ePurpose := NBS.PURPOSE.CLIENT_SIDE , sUseCaseName := 'NBSTest' , sTLSVersion := '1.3' , ciCertInfo := ciCertInfo , udiVerificationMode := 2 ); END_VAR itfAsyncProperty NBS.IAsyncProperty 0 Runs the connect process in a own background task, usage see library Net Base Services. Output xDone BOOL xBusy BOOL xError BOOL eError ERROR Current error state httpResult HttpResult The result of the request
File and Project Information ¶ Scope Name Type Content FileHeader creationDateTime date 14.08.2024, 09:23:19 companyName string 3S-Smart Software Solutions GmbH libraryFile Web Client SL.library primaryProject True productName CODESYS productProfile CODESYS V3.5 SP16 Patch 3 contentFile Web Client SL.clean.json version version 2.0.0.0 ProjectInformation ActivateDongleLicensing bool False OnlineHelp True Released True LastModificationDateTime date 14.08.2024, 09:23:17 FirmCode int 101597 ProductCode 8764 LibraryCategories library-category-list Application|Utils ActivationMail string ActivationUrl AlternativeFirmCodes 5000304 Author CODESYS Development GmbH Company CODESYS CompiledLibraryCompatibilityVersion CODESYS V3.5 SP15 Patch 2 DefaultNamespace WEB_CLIENT Description See: Description DocFormat reStructuredText DocLanguages de,en LanguageModelAttribute qualified-access-only Placeholder Web_Client_SL Project Web Client SL Title Web Client SL Version version 1.11.0.0
Library Reference ¶ This is a dictionary of all referenced libraries and their name spaces. 3SLicense ¶ Library Identification ¶ Placeholder: 3SLicense Default Resolution: 3SLicense, 0.0.0.0 (3S - Smart Software Solutions GmbH) Namespace: _3S_LICENSE Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: True Key: 3SLicense Breakpoint Logging Functions ¶ Library Identification ¶ Placeholder: BreakpointLogging Default Resolution: Breakpoint Logging Functions, 3.5.5.0 (3S - Smart Software Solutions GmbH) Namespace: BPLog Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: True Key: BreakpointLogging CAA Behaviour Model ¶ Library Identification ¶ Placeholder: CAA Behaviour Model Default Resolution: CAA Behaviour Model, * (CAA Technical Workgroup) Namespace: CBM Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: CAA Behaviour Model CAA FB Factory ¶ Library Identification ¶ Placeholder: CAA FB Factory Default Resolution: CAA FB Factory, * (CAA Technical Workgroup) Namespace: FBF Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: CAA FB Factory CAA Segmented Buffer Manager Extern ¶ Library Identification ¶ Placeholder: CAA SegBufMan Default Resolution: CAA Segmented Buffer Manager Extern, * (CAA Technical Workgroup) Namespace: SBM Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: CAA SegBufMan CAA Types Extern ¶ Library Identification ¶ Placeholder: CAA Types Default Resolution: CAA Types Extern, * (CAA Technical Workgroup) Namespace: CAA Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: CAA Types CmpCrypto ¶ Library Identification ¶ Placeholder: CmpCrypto Default Resolution: CmpCrypto, * (System) Namespace: CmpCrypto Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: CmpCrypto CmpErrors2 Interfaces ¶ Library Identification ¶ Name: CmpErrors2 Interfaces Version: newest Company: System Namespace: CmpErrors Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: CmpErrors2 Interfaces, * (System) CmpLog ¶ Library Identification ¶ Placeholder: CmpLog Default Resolution: CmpLog, * (System) Namespace: CmpLog Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: CmpLog CmpX509Cert ¶ Library Identification ¶ Placeholder: CmpX509Cert Default Resolution: CmpX509Cert, * (System) Namespace: CmpX509Cert Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: CmpX509Cert Component Manager ¶ Library Identification ¶ Placeholder: Component Manager Default Resolution: Component Manager, * (System) Namespace: Component_Manager Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: Component Manager IoStandard ¶ Library Identification ¶ Placeholder: IoStandard Default Resolution: IoStandard, 3.5.8.0 (System) Namespace: IoStandard Library Properties ¶ LinkAllContent: True Optional: False QualifiedOnly: False SystemLibrary: True Key: IoStandard Net Base Services ¶ Library Identification ¶ Placeholder: NetBaseSrv Default Resolution: Net Base Services, * (3S - Smart Software Solutions GmbH) Namespace: NBS Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: NetBaseSrv Standard ¶ Library Identification ¶ Placeholder: Standard Default Resolution: Standard, * (System) Namespace: Standard Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: Standard StringUtils ¶ Library Identification ¶ Placeholder: StringUtils Default Resolution: StringUtils, * (System) Namespace: Stu Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: StringUtils SysMem ¶ Library Identification ¶ Placeholder: SysMem Default Resolution: SysMem, * (System) Namespace: SysMem Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysMem SysSocket2 ¶ Library Identification ¶ Placeholder: SysSocket2 Default Resolution: SysSocket2, * (System) Namespace: SysSocket2 Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysSocket2 SysSocket2 Implementation ¶ Library Identification ¶ Placeholder: SysSocket2 Implementation Default Resolution: SysSocket2 Implementation, * (System) Namespace: SysSocket2_Implementation Library Properties ¶ LinkAllContent: False Optional: False PublishSymbolsInContainer: True QualifiedOnly: False SystemLibrary: False Key: SysSocket2 Implementation SysTime ¶ Library Identification ¶ Name: SysTime Version: 3.5.9.0 Company: System Namespace: SysTime Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysTime, 3.5.9.0 (System) SysTypes2 Interfaces ¶ Library Identification ¶ Name: SysTypes2 Interfaces Version: newest Company: System Namespace: SysTypes Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysTypes2 Interfaces, * (System) Util ¶ Library Identification ¶ Placeholder: Util Default Resolution: Util, * (System) Namespace: Util Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: Util Library Parameter ¶ Parameter: IBLOCKSIZE = 22800
BASE64_DECODE (FUN) ¶ FUNCTION BASE64_DECODE Base 64 decoder InOut: Scope Name Type Comment Input diSizeIn DINT Size of ‘in’ in POINTER TO BYTE Input: Pointer to STRING out POINTER TO BYTE Output: Pointer to BYTE array Output diSizeOut DINT
BASE64_ENCODE (FUN) ¶ FUNCTION BASE64_ENCODE Base 64 encoder InOut: Scope Name Type Comment Input diSizeIn DINT Size of ‘in’ in POINTER TO BYTE Input: Pointer to BYTE array out POINTER TO BYTE Output: Pointer to STRING Output diSizeOut DINT
FindJSONValue (FUN) ¶ FUNCTION FindJSONValue : DINT Finds the corresponding value of a key in a JSON String. Objects and arrays are NOT supported. InOut: Scope Name Type Comment Return FindJSONValue DINT Input pwsIn POINTER TO WORD Pointer to JSON wstring udiSizeIn UDINT Size of pwsIn pwsKey POINTER TO WORD Pointer to key wstring diSearchStartPos DINT Startposition of the search Inout wsValue WSTRING(255) Value
FindJSONValue2 (FUN) ¶ FUNCTION FindJSONValue2 : DINT Finds the corresponding value of a key in a JSON String. Objects and arrays are NOT supported. InOut: Scope Name Type Comment Return FindJSONValue2 DINT Input pwsIn POINTER TO WORD Pointer to JSON wstring udiSizeIn UDINT Size of pwsIn pwsKey POINTER TO WORD Pointer to key wstring diSearchStartPos DINT Startposition of the search pwsValue POINTER TO WSTRING Pointer to the result value udiValueSize UDINT Size of pwsValue Output eError ERROR
ConvertUTF16toUTF8 (FUN) ¶ FUNCTION ConvertUTF16toUTF8 : UDINT Converts a WSTRING to STRING InOut: Scope Name Type Initial Comment Return ConvertUTF16toUTF8 UDINT Input sourceStart POINTER TO WORD Pointer to WSTRING targetStart POINTER TO BYTE Pointer to STRING dwTargetBufferSize DWORD Size of STRING bStrictConversion BOOL udiSourceLength UDINT 0 Size of Source string