We have implemented a C++ PLCnext program (called ProtocolBridgeLibrary) that runs in the realtime context. Within our ProtocolBridgeLibrary.ProtocolBridgeLibraryComponent C++ class, we have implemented the IControllerComponent methods Start() and Stop() which simply log that that these methods have been called (e.g. log.Info("Starting the PLC Protocol Bridge ..). However when we use PLCnext Engineer to “Write and Start Project”, there is no evidence in /opt/plcnext/logs/Output.log that Start() is being called. Note we do observe that the log messages associated with LoadConfig() and SetupConfig() gets called. Is it possible that the warning “WARN - Unknown XML element ‘Library’ occurs at (/opt/plcnext/projects/current/Libs/ProtocolBridgeLibrary/ProtocolBridgeLibrary.libmeta:3)” is causing Start to not be called? Note we are using VS Code and CMake on Windows 10 to cross compile for ARM. We have noted that somehow the ProtocolBridgeLibrary.libmeta built by CMake is different ProtocolBridgeLibrary.libmeta that is installed into /opt/plcnext/projects/current/Libs/ProtocolBridgeLibrary/ProtocolBridgeLibrary.libmeta. CMake builds a libmeta file that contains an XML element called “Library” that differs from the libmeta file installed on the PLCnext. The ProtocolBridgeLibrary.libmeta built by CMake under VS Code in the Windows 10 environment contains … Where as the libmeta installed on the PLCnext (/opt/plcnext/projects/current/Libs/ProtocolBridgeLibrary/ProtocolBridgeLibrary.libmeta) is missing the “name” attribute … It should also be noted that the libmeta contains a dependency on libprotobuf.so The details of the versions and log file information is listed below. ARP Device AXCF2152 /opt/plcnext/logs/Output.log [quote] 22.04.21 02:18:16.623 Arp.Plc.Plm.Internal.PlmComponentManager INFO - Component ‘ProtocolBridgeLibraryComponent1’ from library ‘ProtocolBridgeLibrary’ created. 22.04.21 02:18:16.625 ProtocolBridgeLibrary.ProtocolBridgeLibraryComponent INFO - LoadConfig called 22.04.21 02:18:16.626 ProtocolBridgeLibrary.ProtocolBridgeLibraryComponent INFO - SetupConfig called 22.04.21 02:18:16.656 Arp.Plc.Esm.Internal.EsmDomain INFO - ESM configuration successfully loaded. 22.04.21 02:18:16.662 Arp.Plc.Esm.Internal.TaskController INFO - Configuring Sleep class with a sync point interval of 100000us, an watchdog interval of 100000us and an axio interval of 100000us 22.04.21 02:18:16.773 Arp.Io.Axioline.Internal.TicConfig.Tic2ConfigSvc INFO - AXIO Master with 2 devices. 22.04.21 02:18:16.776 Arp.Io.Axioline.AxiolineComponent INFO - AxiolineComponent: SetupPlc(False): Activate /var/tmp/AxlC.config.svc 22.04.21 02:18:17.214 Arp.Io.Axioline.Internal.AxioDataExchange INFO - Axioline use sleep mode 22.04.21 02:18:17.215 Arp.Io.EthernetIP.EthernetIPComponent INFO - LoadPlc, isChanging=false 22.04.21 02:18:17.228 Arp.Io.EthernetIP.EthernetIPComponent INFO - SetupPlc, isChanging=false, startKind=Warm 22.04.21 02:18:17.229 Arp.Io.EthernetIP.EthernetIPComponent INFO - 2929705664 OnPlcLoaded PlcLoaded=false 22.04.21 02:18:17.230 Arp.Io.EthernetIP.EthernetIPComponent INFO - 2929705664 ESDK 0xffff, AddAssemblies, toInstanceID=110, toSize=256, otInstanceID=100, otSize=256 22.04.21 02:18:17.324 root WARN - Unknown XML element ‘Library’ occurs at (/opt/plcnext/projects/current/Libs/ProtocolBridgeLibrary/ProtocolBridgeLibrary.libmeta:3) 22.04.21 02:18:17.592 Arp.Plc.Gds.Internal.GdsDomain INFO - GDS configuration successfully loaded. 22.04.21 02:18:17.780 Arp.Plc.Gds.Internal.GdsDomain INFO - GDS data connections successfully created. 22.04.21 02:18:17.794 Arp.Services.Ehmi.EhmiComponent INFO - 2646979264 EhmiComponent: OnPlcLoaded 22.04.21 02:18:17.811 Arp.Services.Ehmi.EhmiComponent INFO - 2646979264 TypeDictionary->Load() failure!!! 22.04.21 02:18:17.813 Arp.Services.Ehmi.EhmiComponent INFO - 2646979264 Load Cannot read fileName=data.dictionary.json 22.04.21 02:18:17.814 Arp.Services.Ehmi.EhmiComponent INFO - 2646979264 DataDictionary->Load() failure!!! [/quote] Libmeta built by CMake Libmeta installed on PLCnext PLCnext runtime version (cat /etc/plcnext/arpversion) Arpversion: 21.0.3.35554 Svn Revision: 35554 Build Job: “jenkins-PLCnext-Yocto_AXCF2152-release%2F21.0.x-105” PLCnext Engineer version 2021.3 PLCnext SDK version (plcncli sdks) { "targets": [ { "name": "AXCF2152", "version": "21.0.3.35554", "longVersion": "2021.0.3 LTS (21.0.3.35554)", "shortVersion": "21.0.3", "available": null } ] }
Hi Julie, I have a PLM component that implements IControllerComponent, and overrides the Start and Stop methods, and it seems to work OK for me - these methods are called when expected. [quote]when we use PLCnext Engineer to “Write and Start Project”, there is no evidence in /opt/plcnext/logs/Output.log that Start() is being called. Note we do observe that the log messages associated with LoadConfig() and SetupConfig() gets called.[/quote] When you hit the Stop button in the PLCnext Engineer device cockpit, does this call the “Stop” method on your PLM component? When you hit the “Hot Start” button, does this call the “Start” method? [quote]Is it possible that the warning “WARN - Unknown XML element ‘Library’ occurs at (/opt/plcnext/projects/current/Libs/ProtocolBridgeLibrary/ProtocolBridgeLibrary.libmeta:3)” is causing Start to not be called?[/quote] I don’t think this is a problem. I also get those warning messages. [quote]somehow the ProtocolBridgeLibrary.libmeta built by CMake is different ProtocolBridgeLibrary.libmeta that is installed into /opt/plcnext/projects/current/Libs/ProtocolBridgeLibrary/ProtocolBridgeLibrary.libmeta.[/quote] I don’t see that behaviour in my project. The .libmeta file on the PLC is identical to the one in my project, which is generated before every build by the PLCnext CLI. [quote]CMake builds a libmeta file that contains an XML element called “Library” that differs from the libmeta file installed on the PLCnext.[/quote] The .libmeta file on my PLC does contain this Library element. What command are you using to package the libmeta file from your project into the PLCnext Engineer library file? Out of interest, what CMake command are you using to build the XML configuration files file for your project? [quote]Note we are using VS Code and CMake on Windows 10 to cross compile for ARM.[/quote] When you say you are using CMake, are you calling CMake directly from a Windows command prompt (or from within VS Code) to build the project? Or, are you using the PLCnext CLI tool to build the project? If building using CMake directly: [list] []Did you use the PLCnext CLI tool to generate your project template initially? []Are you using the CMakeLists.txt file that was generated from the PLCnext CLI? []You will need to re-generate the support code and the configuration files before every build, and the only practical way to do this is using the PLCnext CLI tool. Is this happening? []After the .so file is built, it must be packaged into a PLCnext Engineer library file, and the only practical way to do this is using the PLCnext CLI tool. Is this happening? []Every time a new PLCnext Engineer library is built, are you adding the new version of that library to the PLCnext Engineer project and sending that project to the PLC? Or are you deploying new versions of your component to the PLC some other way? [/list] If building using the PLCnext CLI: [list] []Exactly what plcncli command(s) are you using to build the project? [/list] [quote]It should also be noted that the libmeta contains a dependency on libprotobuf.so [/quote] I see that this only appears in the online version of the .libmeta file. Is this a dependency for your project? If so, do you know how this dependency got into the online version of the .libmeta file, but not in the offline version? [quote]Libmeta installed on PLCnext[/quote] Just for the record, can you give us the path where this file is located on the PLC?