System information gathering functions

These functions include a version request and an IP4 request function.

FPWEB_GET_VERSION

This function returns an FP-I4C version number.

Call

FPWEB_GET_VERSION(source);

Result

The version number as a hex/BCD value (V1.23 returns 16#0123)

Example

DT[1000] := FPWEB_GET_ VERSION (1);

Parameters

source
  • 0: Returns the version of the script feature
  • 1: Returns the version of the Linux version
  • 2: Returns the version of the FP-I4C operating system

FPWEB_GET_IP4

This function allows you to get information about the current state of the Ethernet interface, such as the IP address or the cable connection.

This function can be called continuously.

Each item must be requested separately.

The IP numbers are in Big Endian byte order and can be changed to a readable STRING in the PLC by the function IPADDR_TO_STRING.

Compatibility:

  • The FP-I4C unit uses ETH0 and ETH1 instead of ETH (FPWEB2) to specify the interface.

  • Configuration file settings and the ADDRESS2 and DHCP items are not supported by the FP-I4C unit.

  • The STATUS item only returns cable connection information.

Call

FPWEB_GET_IP4(interface, item);

Result

The IP address or status as a DWORD value

Parameters

interface, item

The Ethernet interface ("ETH0", "ETH1", "BR0", or "DNS") and the item to be evaluated

  • "ETHx", "ADDRESS": Requests the current primary IP address of the specified Ethernet interface.

    Example: DDT[30] := FPWEB_GET_IP4("ETH0", "ADDRESS");

  • "ETHx", "NETMASK": Requests the current primary IP netmask of the Ethernet interface.

  • "ETHx", "NETMASK2": Requests the current secondary IP netmask of the Ethernet interface.

  • "ETHx", "GATEWAY": Requests the current gateway address used by the Ethernet interface.

  • "ETHx", "STATUS": Requests the status of the Ethernet interface.

    • 0: The cable is disconnected
    • 1: The cable is connected
    • -1: The interface is malfunctioning

    Example: DDT[46] := FPWEB_GET_IP4("ETH0", "STATUS");

  • "ETHx", "MAC": Requests the current MAC address of the Ethernet interface.

    Example: DT[44] := FPWEB_GET_IP4("ETH0", "MAC");

  • "BR0", "ADDRESS": Requests the current IP address of both Ethernet interfaces (available if Bridge/Switch Service is enabled in System Settings).

  • "DNS": Requests the stored settings, not the current state.

  • "DNS", "NAME_SERVER1": Requests the setting of the primary DNS (Domain Name Server) IP address.

    Example: DDT[40] := FPWEB_GET_IP4("DNS", "NAME_SERVER1");

  • "DNS", "NAME_SERVER2": Requests the setting of the secondary DNS (Domain Name Server) IP address.

  • "PORT_INBOUND": Requests the number of connections established by a TCP listening port.

    • -1: Number of connections could not be determined/error
    • 0: Not connected
    • ≥1: Number of open connections

    Specify the port number in the request (decimal value, e.g. 9094, or hex number, e.g. 16#2386).

    Values: 0 to 65535 (16#0 to 16#FFFF)

    Example: WI[16004] := FPWEB_GET_IP4("PORT_INBOUND", "9097");

  • "PORT_OUTBOUND": Requests the number of connections established by a TCP send port. There can be only one connection.

    • -1: Error
    • 0: Not connected
    • 1: Connected

    Specify the port number in the request (decimal value, e.g. 9094, or hex number, e.g. 16#2386).

    Example: DT[100] := FPWEB_GET_IP4("PORT_OUTBOUND", "9094");

Modified on: 2021-11-15Feedback on this pagePanasonic hotline