Cannot link an OUT STRING512 to a C++ ACF IN StaticString when contained in a STRUCT?

I am using PLCnext Engineer 2021.0.1 (Build 4.7.1144.0). I have written a C++ ACF program and in the ACFProject1Component.hpp I have declared …

struct DigitalInputConfig
{
StaticString<512> path;
};

//#port
//#attributes(Input)
DigitalInputConfig digitalInputsConfig[2];

In my PLCnext Engineer project, I defined Programming ⇒ Local ⇒ DataTypes to have the following …

TYPE
DigitalInputConfig : STRUCT
path : STRING512;
END_STRUCT
END_TYPE

TYPE
digitalInputsConfig : ARRAY[0..1] OF DigitalInputConfig;
END_TYPE

In a new local Program, I create a OUT variable of type digitalInputsConfig called "foo ". After I have done this, however, I cannot link "foo " to the IN "ACFProject1Component1 / Program1 : digitalInputsConfig ". BUT if I change the “StaticString<512>” to “StaticString<80>” and “STRING512” to “STRING”, I can link the OUT variable “foo” to the IN “ACFProject1Component1 / Program1 : digitalInputsConfig” with no problems.`` I don’t understand why the StaticString does not work with STRING512 when contained in a STRUCT?

Hi Julie, Custom-length strings in structs were not supported in PLCnext Engineer version 2020.6, as mentioned in this example C++ project: https://github.com/PLCnext/CppExamples/blob/master/Examples/CppDataTypeTest/README.md 2021 02 08 10 20 48 I suspect that this has not been fixed in PLCnext Engineer version 2021.0.1, but I will confirm this and let you know. ~ Martin.

Hi Julie, I can now confirm that PLCnext Engineer does not yet support the connection of Struct ports between C++ and IEC programs, if the struct port contains custom-length strings. There is currently no timeframe for the implementation of this feature (sorry). The best work-around at the moment is to create your own .gds.config file on the PLC, similar to the PCWE.gds.config file in the projects/PCWE/Plc/Gds directory, and place that new file in the projects/Default/Plc/Gds directory. ~ Martin.