F_CreateIPv4Addr

F_CreateIPv4Addr 1:

The function generates a formatted (IPv4) Internet protocol network address and returns it as a return parameter of type string (e.g. 172.16.7.199).

FUNCTION F_CreateIPv4Addr : T_IPv4Addr

F_CreateIPv4Addr 2: Inputs

VAR_INPUT
    nIds : T_IPv4AddrArr;
END_VAR

Name

Type

Description

nIds 

T_IPv4AddrArr

Byte array: Each byte corresponds to one address byte of the (IPv4) Internet Protocol network address. The address bytes have the network byte order (type: T_IPv4AddrArr).

Example in structured text:

PROGRAM MAIN
VAR
    ids   : T_IPv4AddrArr := 172, 16, 7, 199;
    sIPv4 : T_IPv4Addr := '';
END_VAR

sIPv4 := F_CreateIPv4Addr( ids );(* Result: '172.16.7.199' *) 

Requirements

Development environment

Target system type

PLC libraries to include (Category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (System)