Closed Adito5393 closed 3 years ago
Why was the feature-request
label automatically set? Please change it to the bug
label.
The installation instructions at each example are still valid. As this repository has been moved from gitlab>github. The Gitlab CI build instructions are no longer maintained and will be removed. We will probably adapt them to github actions and create a build plcnext github actions project as well.
@OWarneke Were you able to reproduce the error?
I just want to be able to use the plcncli
to compile a C++ project, in the "PLCNext structure" that it is explained in the docs, and deploy it to the AXCF2152
.
Could you provide a working example?
Just to clarify: Are you looking to use the plcncli to compile one of the C++ examples in this repository? If so, there are build instructions in the README for each of the examples. Those instructions do not use the build-local.sh script which, as Oliver mentioned, has not been updated recently. If the instructions in the README file (for any example) is not clear, we can point you to background articles that might help, and possibly improve those instructions. Or, are you looking to use the plcncli to compile your own C++ project, perhaps a stand-alone executable project? There are different plcncli templates, different commands, and different deployment mechanisms depending on the nature of the application.
@Adito5393 but using bash scripts?
In the readme you can finde these instructions:
Compile the code with the PLCnext CLI Install Eclipse IDE, CLI, SDK and Eclipse Add-in (how-to guide: see links in the "Getting started" section above) Clone this repository Navigate to the project you want to test, e.g. cd Examples/ProgramComponentInteraction Execute plcncli new project -c DummyC -p DummyP && ls -la src && rm src/Dummy* Execute plcncli set target --add --name AXCF2152 --version 2020.6 to specify details of the build target Execute plcncli generate all to generate intermediate code and Config files Execute plcncli build to build the code. Execute plcncli deploy to generate a .pcwlx file that can be included in PLCnext Engineer
so wrapping these into a bash could look like this:
#!/bin/bash
cd Examples/ProgramComponentInteraction
plcncli new project -c DummyC -p DummyP && ls -la src && rm src/Dummy*
plcncli set target --add --name AXCF2152 --version 2021.0
plcncli generate all
plcncli build
plcncli deploy
tools/*.sh files are unfortunatly for the 2019.0 plcncli Version so there have been alot of changes to the input and output format so the scripts will not work with the most recent example changes and plcncli version.
Thanks, indeed the commands you highlighted are working. 👍
To avoid future confusion, you could update the repo's README.md
by adding (NOT WORKING / DEPRECATED for 2021.0)
to the Compile using build-local.sh script section.
Environment (please complete the following information):
Describe the bug I tried to compile an example from here (CppDataTypeTest) using the build-local.sh. I have manage to narrow it down to something going wrong with the
build-forOneTarget.sh
script (i.e.plcncli build
command). See the LOG OUTPUT section for the error.To Reproduce Steps to reproduce the behavior:
tools/build-local.sh
file:BUILD_HARDWARE="AXCF2152"
&&PROJECTNAME="CppDataTypeTest"
DIR=$PWD
instead ofDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
$DIR/
for all relative paths: code line: 24, 25 and 26plcncli set target -n $BUILD_HARDWARE --add --verbose --path $DIR/build/$PROJECTNAME
before line 30 (Create Config and Code)chmod +x tools/build-local.sh
&&./tools/build-local.sh
Expected behavior Obtaining the
libCppDataTypeTest.so
using the plcncli from a C++ project.LOG OUTPUT Here is the relevant output:
The
CppDataTypeTestComponent.hpp
file is there before thebuild-forOneTarget.sh
is executed. Are all the sh scripts still valid for the new CLI version? What commands am I missing?Complete LOG output: