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

VAR_INPUT
    nIds : T_IPv4AddrArr;
END_VAR

nIds: Byte array. Every byte is equivalent to one number of the (IPv4) Internet Protocol network adress. The address bytes are represented in 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)