Skip to main content

"The Safe House" Scenario: vPLC + vSafe + ProfiSafe + Time Provider + License Server

_rtsl_img_scenario_safe_house.png

Note

The documentation on the following pages is provided for informational purposes only. For restrictions and safety or certification information, please consult the safety documentation of the manufacturer of the device that you are programming.

Requirements

  • Scenarios:

    The requirement for this scenario is the successful setup of the "Virtual with Fieldbus" Scenario: vPLC + License Server + Edge Gateway + Fieldbus.

  • Hardware

    The following devices are also required:

    • Desktop PC with CODESYS Development System installed

    • Linux Host PC with virtual Edge Gateway, virtual PLC 1, and license server installed

    The following additional devices are also required:

    • Host for the time provider, named Linux Host PC 2 in the diagram. Requirements for this host: Linux operating system and Docker must be installed and SSH configured.

    • Real-time capable network to the Linux Host PC to ensure deterministic transmission of data packages.

  • Add-on products

    CODESYS Virtual Safe Control SL must be installed on the desktop PC.

Linux Host PC 2

On the Linux Host PC 2, set up the time provider.

The time provider sends the current time to a configured destination and can be used to provide the second time required by the Virtual Safe Control SL.

  1. Execute the command ToolsDeploy Control SL and establish a connection to the Linux Host PC 2 (Communication tab).

    For more information, see: Establishing a Connection

  2. Install the latest versions of the following images (Deployment tab):

    • CODESYS Virtual Safe Time Provider

    For more information, see: Installing an image

  3. Click the Deployment tab.

  4. In the Product list box, select CODESYS Virtual Safe Time Provider SL.

  5. In the Version list box, select the newest version.

  6. Click the Install button.

    The CODESYS Virtual Safe Time Provider SL image appears in the Installed Images section.

  7. Create the required instances.

    On the Linux Host PC 2, the timeprovider instance is required, which you create as follows on the Operation tab:

    1. In the VPLCs section, click the _visu_icon_plus.png button.

      The Add New Instance dialog opens.

    2. Specify timeprovider as the name.

    3. In the Filter list box, select Safety Timeprovider.

    4. Select the latest version of the CODESYS Virtual Safe Timeprovider SL image and click OK.

      The new instance is listed in the VPLCs section.

  8. Configure the instances:

    The target IP address and the target port must be configured for the timeprovider instance. The target is the vHost and port 60000 by default.

    Genericcommands:

    -e TARGET_IP=[IP or host name of the Linux Host PC]

    -e TARGET_PORT=60000

    60000 is the default port for a Virtual Safe Control SL to receive an external time source from the timer.

    Autostart

    Yes

    When Yes is selected, the instance is started automatically each time the system is booted.

    1. In the VPLCs section, click the timeprovider instance.

      The settings for the timeprovider instance are displayed on the right side. the TARGET_IP and TARGET_PORT are already pre-assigned under Genericcommands with the values vSafePLC1 and 60000.

    2. Change the TARGET_IP to the host name or the IP address of the Linux Host PC 1.

      For more information, see: Detecting the network address

    3. In the Autostart list box, change the value to Yes.

    4. Click the Save button to save the changes.

    For more information, see: Creating and configuring a new instance

  9. Start the instance.

    Start the timeprovider instance by selecting it in the VPLCs section and then clicking the _prf_icon_start.png Start Selected button.

    In the State column, the status of all instances changes to Running.

Linux Host PC

On the Linux Host PC, set up the CODESYS Virtual Safe Control for Linux SL.

  1. Execute the command ToolsDeploy Control SL and establish a connection to the Linux Host PC 2 (Communication tab).

  2. Switch to the Operation tab.

  3. Install the latest versions of the following images (Deployment tab):

    • CODESYS Virtual Safe Control SL

  4. Create the required instances.

    On the Linux Host PC 1, the vSafePLC instance is required, which you create as follows on the Operation tab:

    1. In the VPLCs section, click the _visu_icon_plus.png button.

      The Add New Instance dialog opens.

    2. Specify vSafePLC as the name.

    3. In the Filter list box, select Safety runtime system.

    4. Then select the latest version of the CODESYS Virtual Safe Control for Linux SL image.

    5. Then click OK.

      The new instance is listed in the VPLCs section.

  5. Together with the instances which you created on this device in the last scenario, the following instances should now be available in the VPLCs section:

    Instance

    State

    Product

    vGateway

    Stopped

    Gateway

    vPLC

    Stopped

    Runtime system

    vSafePLC

    Stopped

    Safety runtime system

  6. Check whether the following entry is available in the Services section:

    Product

    State

    CODESYS LicenseServer for Linux SL

    Running

  7. Before reconfiguring, click the Stop All button to stop the instances.

    The state of all instances changes to Stopped.

  8. In the VPLCs section, click the vSafePLC instance.

    The settings for the vSafePLC instance are displayed on the right side.

  9. Configure the vSafePLC instance as follows:

    Ports:

    60000:60000/udp

    This is the default port for a Virtual Safe Control SL to receive an external time source from the time provider

    Ipc:

    container:vPLC

    Access to the IPC namespace of the vPLC instance for communication between these two instances.

    Dependencies:

    vPLC

    The vPLC must be started first because this creates the IPC namespace that this instance wants to join. A dependency will ensure the correct starting order.

  10. In the VPLCs section, click the vPLC instance.

    The settings for the vSafePLC instance are displayed on the right side.

  11. Configure the vPLC instance as follows:

    IPC:

    shareable

    Create an IPC namespace for this container that can be used by other containers. In this case, the vSafePLC instance should join for the communication between these two instances

  12. Start the instances.

    In the VPLCs section, click the _prf_icon_start.png Start All button to start all instances.

    In the State column, the status of all instances changes to Running.

  13. Check the configuration.

    To make sure that the times of the timeprovider arrive at the vSafePLC as desired and configured, you can check this in the log of the instance.

    1. To do this, select the vSafePLCs instance in the VPLCs section.

    2. In the Actions section at the top right, click the Show Log button.

      The Runtime System log window opens.

      The message External Time Provider found exists in the log.

All the required devices are now ready. The next steps for creating a project and integrating PROFIsafe are described in the CODESYS Safety Extension documentation.