Step 2: Configure the PLCs

In this step, we will work with the Control FPWIN Pro7 example that can be downloaded from the TLS Client/Server page in the FP-I4C units's application settings.

TLS client configuration

  1. Create a project with the Control FPWIN Pro7 example.

  2. Check the Tasks and enable ClientTLS (disable ServerTLS). This POU is used to control the client part.

  3. Use the function block FPI4C_TLS_Connector of the FP-I4C library for Control FPWIN Pro7. For the client part, the input bListenTLS must be FALSE.

  4. When bOnline of the function block FPI4C_TLS_Connector turns TRUE, communication can start. The Modbus data transmission is performed by the function FP_READ_FROM_SLAVE_AREA_OFFS.

  5. This example runs on user connection 1, which must be configured as follows:

    • Communication mode: Modbus TCP master/slave
    • Open method: Client connection
    • Destination IPv4/IPv6 address: 192.168.0.1 (IP address of ETH1 on FP-I4C unit)
    • Destination port number: 8888
  6. The data fetched from ‘Read Holding Register’ is stored in awDataReceived.

  7. Finally, as a test, we can compare the result with the preset data stored in g_awTestDataToReadByClientTLS.

TLS server configuration

  1. Create a second project with the same Control FPWIN Pro7 example.

  2. Check the Tasks and enable ServerTLS (disable ClientTLS). This POU is used to control the server part.

  3. Use the function block FPI4C_TLS_Connector of the FP-I4C library for Control FPWIN Pro7. Set the input bListenTLS to TRUE.

  4. Use the function block to monitor the status.

  5. In our example, the decrypted data will be forwarded from the FP-I4C unit via ETH1 to the configured user connection 1 of the PLC (Modbus TCP server port 502).

  6. Except for some address settings, no additional configuration or program code is needed in the PLC.

Additional settings

  1. Check the addresses in the global variables.

  2. Check the IP address of the PLC. We recommend to use a private zone. If you want to use another IP address, you must also configure it later in the FP-I4 unit.

  3. Check the system connection port for the Control FPWIN Pro7 communication (32769 is the default setting).

  4. Make sure the IP address and port of the user connection used to transmit the plain Modbus TCP requests match your FP-I4C settings.

  5. Compile your program.

Run the PLC program

  1. Install the Ethernet cables between ETH1 of the FP-I4C unit and the PLC. This network is a private zone for the PLC and the FP-I4C unit.

  2. Control FPWIN Pro7 can be connected either in the private zone or in the LAN via DHCP.

  3. To go online, use the settings according to the network used and transfer the sample program to the PLC.

    • In a private zone, connect to: 192.168.0.2, port 32769.
    • In a DHCP LAN, connect to: 192.168.178.11 or …12, port 9094.

Letzte Änderung: 2024-03-14Feedback zu dieser SeitePanasonic Hotline