Alexander72
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.
[203128%2F9828406%2Fmceclip0]
 
[203128%2F9828409%2Fmceclip0]
 
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]: | ^

[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.

Alexander72
I renamed the Ain data type to AI_STRUCT and everything compiled fine.
But I encountered a new problem: I can't see my array in the tag tree in the OPC UA client. For testing, I created an array of BOOLs, and the client can see it.
What could be the problem?
 
[203128%2F9828549%2Fmceclip0]
OPC UA Expert:
[203128%2F9828552%2Fmceclip0]
Reply 0 0
thiagoralves
Hello,
The OpenPLC forum has a new home: AutonomyEdgehttps://edge.autonomylogic.com. We migrated every member, profiles, topics, categories and attachments. Please redo your post on the new forum so we can continue our conversation.
Note: If you already have an Autonomy Edge account, you can simply login with your credentials to have access to your forum profile and posts. If you don't have an Autonomy Edge account, we ask you to set a fresh password on first sign-in using the same e-mail you used on this forum.
To set a fresh password, access the link https://edge.autonomylogic.com/forgot-password and insert the e-mail address used on this forum. You will receive an e-mail on your inbox with a link to choose a new password. Once you reset your password you will be able tologinonedge.autonomylogic.com using your new credentials.
Reply 0 0
Reply