Invalid program type C++

Dear Community, When creating a C++ application named CSVtoSQL and adding the program to a task, I get the following error: The programming instance “cplusplus” has an invalid program type “CSVtoSQL.MyComponent.MyProgram”. Does anyone know why this error pops up? I am using the RFC 4072s. Best regards, Stijn Noppe

Hello Stijn, I assume there is a problem with the namespace of the project name, please create a new project with the name “CSV_to_SQL” and instantiate the program.again. Best Regards Eduard

Hi Eduard, Apparently the name Is not the problem since I tried to delete the project and made a new one (same names for project,component and program as before). After importing the newly created program in PLCnext Engineer I had no error anymore. From as soon I added a new port to my program from the type StaticString, PLCnext engineer crashes when it tries to refresh the library. When opening PLCnext Engineer again, the error pops-up again! The strange thing is that from then on, even if I delete that port and rebuild, the library is corrupt and I need to start over. At first I thought it was because the automatic refresh of the library happened during online mode but at a later stage I had it as well when not being online nor in debug mode. My feeling is that the RFC4072s(FW 2019.0 LTS) has problems with the StaticString type. Best regards, Stijn Noppe

Hello Stijn, please don’t use the port variable with datatype StaticString, this datatype is not supported as port variable. You can define a Byte-array as port-variable and convert the data to string. For example define in Cpp program your string varibale as uint8[255] array and conntect it in PLCnEng-Program with BYTE[0..254]. In PLCnEng use the FB “BUF_To_STRING” for conversion. Please see also the CppDataTypeTest project on GitHub with all supported and tested port-variables: CppExamples/Examples/CppDataTypeTest at master · PLCnext/CppExamples · GitHub Best Regards Eduard

Hello Eduard, I do not really get how I can send a string back to PLCnext Engineer. When converting a char* to uint8 pointer I get the error that I could have data loss and that it is not permittable by c++ standar. Best regards, Stijn Noppe