Role Mapping in the GDS Port List: Assigning PLCnext Ports
This topic contains the following sections:
The GDS Port List of the 'PLCnext' PLANT node contains all ports which are available in the project (defined in a local program POU or contained in an included externally developed program). The GDS Port List of program instance nodes in the PLANT contains the ports relating to the respective instance.
Example for a program instance with instance-related I/O variables and PLCnext ports
Ports are either declared in a local program POU with one of the keywords 'IN Port' or 'OUT Port' or they are part of and handed over from instantiated external programs. IN and OUT ports can be assigned (mapped) to each other. This way, data can be transferred between programs developed in the current project and externally developed programs (for example using C++) which are instantiated in a task.
Background: Ports of PLCnext Technology controllers
How to assign ports
The mapping of ports in a GDS Port List is done by simply selecting an entry in the corresponding columns using the Role Picker as follows:
Note
In Data Lists, Port Lists and variables tables, the selection in drop-down lists is done with a single-click, not with a double-click. |
- In the table, left-click into the field where you want to assign a data item and which is showing the text 'Select ... here' or move the table cursor using the arrow keys or <Tab>/<Shift>+<Tab> to this table field and press <Enter>.The Role Picker appears. It is divided into a tree on the left and data items on the right. The Role Picker only provides data items for selection which match the data type for the assignment to be done.
- Select a folder in the tree on the left and then the data item on the right by clicking it or pressing the <Enter> key.
Note
The Role Picker retains your last selection as long as the editor has not been closed. |
Use the following keys to navigate in the Role Picker:
Press the shortcut ... | ... to ... |
---|---|
<Tab>/<Shift> + <Tab> | switch between the folders on the left and the entries on the right. |
<ArrowDown>/<ArrowUp> | move the cursor down/up. |
<Enter> (focus on the right side) | select the currently marked entry, close the selection control and apply the entry to the table field. |
<ArrowRight>/<ArrowLeft> (focus on the left side) | expand/collapse the currently marked folder on the left. |
Note
Ports may be of complex data types, such as arrays or structs. In this case, the Role Picker in the GDS Port List supports the selection of individual port members. After disconnecting a port member, it remains unconnected in the GDS Port List. It can then be deleted with the toolbar command 'Delete unconnected port member'. See topic "Ports of user-defined data types" for details. |
1-to-n assignment for output ports
Output ports can be read several times in an application. The GDS Port List allows to assign an output port to several input ports (1-to-n assignment). For that purpose, the output port has to be duplicated. Duplicating is only possible for already assigned output ports.
Proceed as follows to assign an output port to several input ports in the GDS Port List:
- Assign the desired output port to an input using the Role Picker as described above.
- Duplicate the output port by selecting its table row and choosing 'Duplicate Output Port' from its context menu or clicking the corresponding button on the Data List toolbar:
- Assign the duplicated output port to the desired input port.
- Repeat steps 2 and 3 if desired: create and assign another copy of the output port.
Removing 1-to-n assignment and deleting duplicated output ports
- Delete an assignment between a duplicated output port by selecting the context menu command 'Disconnect IN Port' or selecting the respective button on the Data List toolbar:
- Delete the duplicated output port which is no longer assigned now:
- Repeat steps 1 and 2 for each duplicated port to be deleted.
Rules for assigning ports
The following rules apply when mapping ports in the GDS Port List.
Use case 1: Both data types to be assigned are elementary data types...
Use case 2: both data types to be assigned are arrays...
Use case 3: both data types are structures
Use case 4: both data types are enumerations
Use case 7: special handling of safe FDCML datatypes (i.e., safe process datum)