Ports of user-defined Data Types
Ports can be of user-defined data types, such as arrays or structures. You can create such a user-defined port in the same way as a variable of a user-defined data type:- Enter the type definition in the data type worksheet using the TYPE ... END_TYPE declaration keywords.
- Declare a port of the user-defined data type: Set the 'Usage' to 'IN Port' or 'OUT port' when declaring the port in a program POU.
Now you can use the elements contained in the user-defined types in the program code.
Also external (non-IEC 61131-3) programs may contain ports of complex data types.
Handling port members in the GDS Port List
In the GDS Port List (of the 'PLCnext' node or of a program instance node in the PLANT), you can assign individual members of such a port to another port. When opening the Role Picker for an assignment, suitable port members are offered for selection.
Example
The OUT port MyPortArray is a user-defined ARRAY data type:
MyArray : ARRAY[0..9] OF BOOL;
When opening the Role Picker for a Boolean port in the GDS Port List, the individual port members are offered for selection.
The first bit of the array has been mapped to Boolean IN port:
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':