Transmission functions

The transmission functions include a copy, a ping, an email, and an FTP function.

FPWEB_COPY_DT

This function copies data (DT/WI registers) from a source to a target.

This function can be called continuously.

If the target is a PLC, make sure to write to your defined data area to avoid program runtime errors in the target PLC.

The target can also be the internal memory areas of the FP-I4C unit ("INTERN"). This is useful, for example, to collect data from different sources and make it available in HTML pages or supply it to the data logger.

Call

FPWEB_COPY_DT(source interface, source station number, source DT/WI address, target interface, target station number, target DT/WI address, number of DTs/WIs);

Result

The function returns 0 if successful or -1 if an error has occurred.

Example

FPWEB_COPY_DT("RS232", 1, 10, "INTERN", 1, 50, 30);

Parameters

source interface

The name of the communication interface of the source device

  • "RS232"

  • "RS232_L": Function code 0x04 [input register] instead of 0x03 [holding register], for Modbus only; if used for other protocols, it will be treated as "RS232".

  • "RS485"

  • "RS485_L": Function code 0x04 [input register] instead of 0x03 [holding register], for Modbus only; if used for other protocols, it will be treated as "RS485".

  • "USB"

  • "ETHERNET": Communication via Modbus/TCP

  • "ETHERNET_L": Function code 0x04 [input register] instead of 0x03 [holding register], for Modbus/TCP only.

  • "INTERN": INTERN refers to the internal memory areas.

source station number

The station number of the source device

  • 1–99: all interfaces

  • 100–247: additional addresses for ETHERNET

  • 0: Multicast (serial interfaces)

source DT/WI address

A DT start address in the source PLC or a WI start address in the FP-I4C unit

The valid DT address range varies depending on the PLC type and the protocol used. The WI address range is 0 to 33120.

target interface

The name of the communication interface of the target device

  • "RS232"

  • "RS485"

  • "USB"

  • "ETHERNET": Communication via Modbus/TCP

  • "INTERN": INTERN refers to the internal memory areas

target station number

The station number of the target device

  • 1–99: all interfaces

  • 100–247: additional addresses for ETHERNET

  • 0: Multicast (serial interfaces)

target DT/WI address

A DT start address in the target PLC or a WI start address in the FP-I4C unit

The valid DT address range varies depending on the PLC type and the protocol used. The WI address range is 0 to 33120.

number of DTs/WIs

The number of registers to copy

The valid range varies depending on the PLC type and the protocol used. For the FP-I4C unit, the range is 1 to 33121.

FPWEB_EMAIL

This function controls the active email transmission similar to the PLC-controlled email client function.

Use this function only if you need additional settings that cannot be made on the Script page.

This function can be called continuously.

Transmission starts as soon as the specified time is reached if the file to send is available.

Call

FPWEB_EMAIL(file format, rename text, splitting mode, time, cycle, number of retries, file number);

Result

Number of transmitted files or 0 in case of no files to transmit

Parameters

file format

The file name format of the source file to be sent in quotation marks

  • "DEFAULT_FORMAT": Use this value if you have selected a user-defined format file.

  • Any character string and the following variables:
    • %y (small year, two characters)
    • %Y (full year, four characters)
    • %m (month as number, 01–12)
    • %d (day as number, 01–31)
    • %W (calendar week)
    • %j (day of the week)
    • %H (hour)
    • %M (minute)
    • %S (second)
    • %F (log file name set in Data Logger > Log file settings
    • %x (batch number with 5 digits, 0–65535)
    • %X (batch number with 10 digits, 0–4294967293)

    Batch numbers without a date information cannot be sent correctly.

Example: "AnyName%y%m%d_%H%M%S_TRG).CSV"

rename text

The file name extension for successfully transmitted files

  • Any character string (max. 7 characters)

  • Empty: The default file name extension ".CS_" is used.

  • "DELETE": The file will be deleted.

splitting mode

File splitting information to detect currently active log files and to avoid sending incomplete log files

  • "MINUTE"
  • "HOUR"
  • "DAY"
  • "WEEK"
  • "MONTH"
  • "YEAR"
  • "SPLIT_OFF"

Example: For "DAY", only files from before the current day will be sent.

If file format="DEFAULT_FORMAT", the splitting mode set in the user-defined file format is applied.

time

The starting time of the transmission after midnight in seconds

0: Default value (midnight)

If the value set is < 120s (or 0 for midnight), the system will start the transmission 120 seconds after midnight. This ensures that the data of logged midnight values is not being transmitted.

Example: For a value of 43200, the first transmission of the day is at 12:00.

cycle

The transmission cycle or the "try to transmit" time in seconds. If the time difference to the last transmission is shorter than the cycle time, the function terminates.

Together with the value for time, this defines the transmission cycle.

60: Default value

Example: For a value of 60, the function tries to send files every minute.

number of retries

The maximum number of retries if the transmission was not successful

After the maximum number of retries has been reached, the function terminates.

file number

The number of the log file

  • 0 to 15: File number

  • -1: All log files

Related topics:

FPWEB_FTP

This function controls the active FTPC transmission similar to the PLC-controlled FTPC function.

Use this function only if you need additional settings that cannot be made on the Script page.

This function can be called continuously.

Transmission starts as soon as the specified time is reached if the file to send is available.

Call

FPWEB_FTP(file format, rename text, splitting mode, time, cycle, number of retries, file number);

Result

Number of transmitted files or 0 in case of no files to transmit

Parameters

file format

The file name format of the source file to be sent in quotation marks

  • "DEFAULT_FORMAT": Use this value if you have selected a user-defined format file.

  • Any character string and the following variables:
    • %y (small year, two characters)
    • %Y (full year, four characters)
    • %m (month as number, 01–12)
    • %d (day as number, 01–31)
    • %W (calendar week)
    • %j (day of the week)
    • %H (hour)
    • %M (minute)
    • %S (second)
    • %F (log file name set in Data Logger > Log file settings
    • %x (batch number with 5 digits, 0–65535)
    • %X (batch number with 10 digits, 0–4294967293)

    Batch numbers without a date information cannot be sent correctly.

Example: "AnyName(%y%m%d_%H%M%S_TRG).CSV"

rename text

The file name extension for successfully transmitted files

  • Any character string (max. 7 characters)

  • Empty: The default file name extension ".CS_" is used.

  • "DELETE": The file will be deleted.

splitting mode

File splitting information to detect currently active log files and to avoid sending incomplete log files

  • "MINUTE"
  • "HOUR"
  • "DAY"
  • "WEEK"
  • "MONTH"
  • "YEAR"
  • "SPLIT_OFF"

Example: For "DAY", only files from before the current day will be sent.

If file format="DEFAULT_FORMAT", the splitting mode set in the user-defined file format is applied.

time

The starting time of the transmission after midnight in seconds

0: Default value (midnight)

If the value set is < 120s (or 0 for midnight), the system will start the transmission 120 seconds after midnight. This ensures that the data of logged midnight values is not being transmitted.

Example: For a value of 43200, the first transmission of the day is at 12:00.

cycle

The transmission cycle or the "try to transmit" time in seconds. If the time difference to the last transmission is short, the function terminates.

Together with the value for time, this defines the transmission cycle.

60: Default value

Example: For a value of 60, each minute the function tries to send files.

number of retries

The maximum number of retries if the transmission was not successful

After the maximum number of retries has been reached, the function will terminate.

file number

The number of the log file

  • 0 to 15: File number

  • -1: All log files

Related topics:

FPWEB_PING

This function checks the communication with other network devices.

The number of ping calls and the ping interval will influence the operation of the script (sequential operation).

Call

FPWEB_PING(IP string, number of ping calls, ping interval);

Result

Number of ping calls with successful answers

Example

DT[10] := FPWEB_ PING(“www.panasonic.com”, 3, 1000);

Parameters

IP string

IP address or URL of the device to test

number of ping calls

Number of ping calls to send

ping interval

Time in seconds (value < 300) or time in ms (value >= 300) between the ping calls

Modified on: 2022-01-11Feedback on this pagePanasonic hotline