Creating Controller Ports

You can create the ports of an external Controller manually or by retrieving the OPC server tags.

If the control ports are created from OPC tags, the connection to an OPC server must be active and the list of OPC tags available.

This task shows you how to:


Before you begin:
  • The System and Device Designer workbench should be opened.
Related Topics
Associating OPC Tags and External Controller Ports

Creating Controller Ports from OPC Tags

You can create the controller ports from the OPC tags retrieved on the OPC server.

  1. Select a list of tags in the OPC Items Browser area. You can select several rows using the Ctrl and Shift keys.



  2. Click Create Ports from OPC Items .

    The control ports are created in the External Control's IOs area.




    • Tree: The Name column of the OPC Items Browser is copied into this cell.

    • Direction: The direction is retrieved from the OPC server. If it is not available, the field remains empty.

    • OPC Item Quality: The quality of the OPC Item is given when applying the Check command .
    • OPC Item Name: The OPC Tag column of the OPC Items Browser is copied into this cell.

    • Comment: You can add a comment if necessary.

    • Type: Types are retrieved on the OPC server and converted to LCM type. The translation is done as follows:

      IEC 61131 type LCM type
      BOOL bool
      BYTE word8
      DWORD bit32
      LWORD bit64
      STRING[128] string8
      SINT int8
      DINT int32
      LINT int64
      USINT uint8
      UINT uint16
      UDINT uint32
      ULINT uint64
      REAL float32
      LREAL float64

      Note: If the OPC tag type is not one of the list, the Controller port cannot be created.

    The ports created are in error because in our example, the OPC server is not able to provide the direction of the ports. The directions have to be set manually.

  3. To set the port directions, do one of the following:

    • Click the Direction column to define the port direction.
    • Select a list of ports by using the multi-selection and right-click the column direction. Select Direction > In or Direction > Out.



    Note: The multi-selection is also available to set the port type.

  4. Select Program:MainProgram in the OPC Items Browser



  5. Click Create Ports from OPC .

    Program:MainProgram is created as a structured port.

  6. Select the newly created ports and set the direction.



Creating Controller Ports from Scratch

You can create manually a controller port by filling its name, type, direction and its OPC item name. In the External Control's IOs area, you can create ports and/or structured ports.

Tip: The same functionality is available when selecting Definition in the External Controller contextual menu. The Extern Block dialog box offers the same commands than the External Control's IOs area.

  1. Click Create Record .

  2. Select the new record and click Create Input .



  3. Change the name, type and comment.



  4. Right-click Port and open its contextual menu.



  5. Select Add Port Children > Element. A new port is added to the record.

  6. Change its name, type and direction.

  7. Add a parameter (refer to the PLC Manufacturer documentation for OPC tags syntax).



  8. Select Data2 and click Erase parameters .

    The OPC Item Name is cleared.



  9. Select Port and click Create Record .

    A new record is created in the record.



  10. To convert the record to an element, right-click the port and select Redefine Port as > Element.

    Note: To remove the port, select the port and click Delete Ports or right-click the port and right-click the port and select Remove in the contextual menu.