Hello,
I created a custom data type called Ain, as shown in the screenshot. Then I added a variable containing an array of the Ain structure to the global variables.
When I tried to compile the solution and load it into the controller, I received an error.
I use the device "OpenPLC Runtime v4".
Could you please tell me what went wrong?
Console:
[21-06-26 18:35:10]: Starting compilation
[21-06-26 18:35:10]: Compiling core/generated/configuration.cpp...
[21-06-26 18:35:10]: /usr/bin/ccache g++ -std=c++17 -O1 -pipe -fPIC -Wall -DSTRUCPP_THREADED -MMD -MP -Wno-unknown-pragmas -Wno-deprecated-declarations -I core/generated -I core/generated/strucpp_runtime/include -I core/src/plc_app/include -include iec_python.h -c core/generated/configuration.cpp -o build/configuration.o
[21-06-26 18:35:16]: In file included from core/generated/configuration.cpp:4:
[21-06-26 18:35:16]: core/generated/generated.hpp:159:23: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T, long long int Lower, long long int Upper> using Array1D = strucpp::IEC_ARRAY_1D<T, strucpp::ArrayBounds<Lower, Upper> >’
[21-06-26 18:35:16]: 159 | Array1D<AIN, 0, 31> AIN_ARR;
[21-06-26 18:35:16]: core/generated/generated.hpp:159:23: note: expected a type, got ‘strucpp::AIN’
[21-06-26 18:35:16]: make: *** [scripts/Makefile.strucpp:112: build/configuration.o] Error 1
[21-06-26 18:35:16]: Build failed (exit=2)
[21-06-26 18:35:17]: mv: cannot stat 'build/new_libplc.so': No such file or directory
[21-06-26 18:35:17]: Cleanup failed (exit=1)
[21-06-26 18:35:17]: PLC program has not been updated because the build failed
[21-06-26 18:35:17]: Compilation failed (exit code: 1).
[21-06-26 18:35:17]: Failed to upload to runtime.
[21-06-26 18:35:17]: Stopping compilation process.
[21-06-26 18:35:17]: -------------------------------------------------------------------------------------------------------------
[21-06-26 18:35:17]: Compilation complete
[21-06-26 18:35:17]: Stopping compilation process.