LGF_StringToTaddr (FC / V3.0.1)

Overview

Author: Siemens Digital Industry

Short description

The system data type TADDR_Param contains address information consisting of an IPV4 address and the port number.

The LGF_StringToTaddr function converts a variable od data type String to a TADDR_Param system data type variable.

Block Interface

LGF_StringToTaddr (FC)
String  ipAddressString Ret_Val  TADDR_Param
    
   error  Bool
    
   status  Word
    
   

Input parameter

IdentifierData type Description
ipAddressStringString IPV4 address string in the format of `192.168.1.200:55047`
[Port number including colon `:` is optional]

Output parameter

IdentifierData type Description
Ret_ValTADDR_Param IP-Address and Port number as `TADDR_Param` data type
errorBool FALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord 16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_FINISHED_NO_ERROR
Status: Execution finished without errors
16#8110ERR_OCTET_WRONG_NUMBER_OF_CHAR
Error: Wrong number / too many characters in the X'th octet of the IP address
16#8120ERR_OCTET_STRING_IS_EMPTY
Error: No number/ character in the X'th octet of the IP address is given - String is empty
16#8130ERR_OCTET_EXCEEDS_MAX_IP_ADDRESS
Error: Maximum possible number of IP address octet exceeded (255)
16#8150ERR_PORT_WRONG_NUMBER_OF_CHAR
Error: Wrong number / to many characters in string port conversion
16#8151ERR_PORT_STRING_IS_EMPTY
Error: No number/ character in the Port string is given - String is empty
16#8152ERR_PORT_EXCEEDS_MAX_PORT
Error: Maximum number of Port exceeded (65535)

Functional description

The function converts the IPV4 address with or without port number from data type String to TADDR_Param.
The string must be in the following form:

####### Example:

Note
If you do not specify a port number in the ipAddressString parameter, the Ret_Val.REM_PORT_NR parameter returns 0.

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
30.01.2017First released version
01.00.01Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.00.02Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.03Simatic Systems Support
10.06.2019Standard header and block parameters update
01.00.04Simatic Systems Support
10.07.2019Code refactoring and performance improvements
01.00.06Simatic Systems Support
14.11.2019Add ENO handling
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0
Harmonize the version of the whole library
03.00.01Simatic Systems Support
23.02.2021Insert documentation