PLCnext Engineer: STRUCT-elements as IN- or OUT-Ports

Hello,

We have a question concerning the definition of IN-Port and OUT-Port variables in PLCnext Engineer.
Since there is an opportunity to use single elements of arrays as an IN-Port or an OUT-Port we were wondering whether it is possible to use single STRUCT-elements as IN-Ports or an OUT-Ports as well.
If yes, can you show us how it is done?
If not, are you considering to implement it in future versions?
Best regards,
Daniel

Hi Daniel, It is possible to connect the elements of a STRUCT port, in the same way as the elements of an ARRAY port.

                                             * Create a STRUCT type in a Data Types sheet.
                                             * Declare an IN or OUT port variable of that STRUCT type.
                                             * In the PLCnext -> Port List sheet, connect an element of the STRUCT variable to an opposing port of the same data type.

This works for me in PLCnext Engineer version 2020.6.2. ~ Martin.

Hi, thank you very much. Since you told us it would be possible, we tried again an made it work. It seems our problem wasn’t the declaration of the variables, but the fact that we hadn’t added a counterpart, which was of the same type as the STRUCT-Element. The choice was enabled after added the counter port of same type. Kind regards, Daniel