We are trying to communicate on RS 232/485 using AXL F RS UNI 1H and AXCF 2152. um_en_plcnext_technology_108664_en_01.pdf mentions that we can create a communication channel with AXL F RS UNI 1H using RSC Axioline service(Section 5.8.1) then use PdiRead and PdiWrite to communicate with device. In order to call these function Slot, subslot, index and subindex are required. Index and subindex are specified in db_en_axl_f_rs_uni_1h_8533_en_04.pdf however we could not find first two parameters(slot and sub slot). Can you please tell where can we find these two parameters? Edit: We are porting our protocol conversion tool for AXCF 2152 using cross compilers(as provided in SDK). We are planning to only include required headers from PLCNext SDK during compilation and run it as an external Application(not in ESM since there are many delays in different threads). Headers for Axioline Communication are available in PLCNext_SDK/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi/usr/include/plcnext/. Can you please tell where are library(.so) files for these declarations?
Hello Vikash, To answer your two questions: Unfortunately I cannot find any documentation that clearly defines the terms “Slot” and “Subslot”, however this should work: Slot = 1, 2, 3, …, n - corresponding to the position of the Axioline I/O module on the local bus (1 = first module to the right of the controller)
Subslot = 0 for most Axioline I/O modules, unless the module documentation specifies otherwise. Library (.so) files corresponding to the header files are on the PLC in the directory /usr/lib, and in the corresponding SDK directory. ==================================== To help your application run smoothly, please check these points: 1. You mentioned that you do not want to use the ESM - this is perfectly fine. In that case you have two main choices for developing a C++ application that uses the PDI read/write methods on the AcyclicCommunication RSC service: a) Develop your program as a PLCnext Component, using the template provided by the PLCnext Command-Line Interface (CLI). b) Develop your program as a stand-alone executable. In this case, you must follow the example given in the Sample Runtime project on Github. This projects shows how to call an RSC Service - in this case, the “DataAccessService” (among others), but in your case it will be the “AcyclicCommunicationService”. This example project also shows the very important call to the ArpSystemModule_Load function, which is required for an exe to access PLCnext services. 2. How are you planning to configure the Axioline bus for your application? This is usually done using PLCnext Engineer, which generates the .tic files that are required for the Axioline bus to start correctly. 3. Once the axioline module has been configured using the PDI methods on the AcyclicCommunicationService, how do you plan to exchange I/O with the serial module? This is normally done using the module’s Process Data, which can be accessed through Global Data Space (GDS) configuration or through the ANSI-C interface shown in the Sample Runtime project. Please let us know if you have any other questions. - Martin.
Hello Martin, Thanks for your response. It was really helpful. We will go with option B. Sample Application seems very promising and simple for our requirement. Before we go ahead with changes for AXL F RS UNI 1H, we wish to compile and verify the build process. However we are facing problem in compilation. Can you please tell how to compile Sample Application using cmake/plcncli/make (without eclipse). We tried replacing src folder with a project generated by plcncli(and removed intermediate/code). However this is giving undefined reference to ArpPlcIo_, ArpPlcDomain_ etc. These symbols are present in provided sysroot libraries but application is not able to link them. Other libraries(ArpDevice and ArpProgramming) are being included using cmake find_package. Can you please tell how to can be generate *.cmake(for find_package) file for ArpPlcIo, ArpPlcDomain etc? Is there any other approach to make new set of libraries available at link time? compilation error comes like this [cmake]: [ 33%] Linking CXX shared library libPLCnextSampleRuntime.so
[cmake]: CMakeFiles/PLCnextSampleRuntime.dir/build.make:125: recipe for target 'libPLCnextSampleRuntime.so' failed
[cmake]: CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/PLCnextSampleRuntime.dir/all' failed
[cmake]: Makefile:129: recipe for target 'all' failed
[cmake]: CMakeFiles/PLCnextSampleRuntime.dir/src/CSampleRuntime.cpp.o: In functionCSampleRuntime::CSampleRuntime()‘:[cmake]: CSampleRuntime.cpp:(.text+0x476): undefined reference toArpPlcDomain_SetHandler'
[cmake]: CMakeFiles/PLCnextSampleRuntime.dir/src/CSampleRuntime.cpp.o: In functionCSampleRuntime::ReadInputData(char const*, char const*, char*, unsigned int)’:[cmake]: CSampleRuntime.cpp:(.text+0xf02): undefined reference toArpPlcIo_GetBufferPtrByPortName'
[cmake]: CSampleRuntime.cpp:(.text+0xf12): undefined reference toArpPlcGds_GetVariableOffset’[cmake]: CSampleRuntime.cpp:(.text+0xf20): undefined reference toArpPlcGds_BeginRead'
[cmake]: CSampleRuntime.cpp:(.text+0xf40): undefined reference toArpPlcGds_EndRead’[cmake]: CSampleRuntime.cpp:(.text+0xf48): undefined reference toArpPlcIo_ReleaseGdsBuffer'
[cmake]: CSampleRuntime.cpp:(.text+0x10b2): undefined reference toArpPlcGds_EndRead’[cmake]: CMakeFiles/PLCnextSampleRuntime.dir/src/CSampleRuntime.cpp.o: In functionCSampleRuntime::WriteOutputData(char const*, char const*, char const*, unsigned int)':
[cmake]: CSampleRuntime.cpp:(.text+0x16ea): undefined reference toArpPlcIo_GetBufferPtrByPortName’[cmake]: CSampleRuntime.cpp:(.text+0x16fa): undefined reference toArpPlcGds_GetVariableOffset'
[cmake]: CSampleRuntime.cpp:(.text+0x170c): undefined reference toArpPlcGds_BeginWrite’[cmake]: CSampleRuntime.cpp:(.text+0x172c): undefined reference toArpPlcGds_EndWrite'
[cmake]: CSampleRuntime.cpp:(.text+0x1734): undefined reference toArpPlcIo_ReleaseGdsBuffer’[cmake]: CSampleRuntime.cpp:(.text+0x189e): undefined reference toArpPlcGds_EndWrite'
[cmake]: CMakeFiles/PLCnextSampleRuntime.dir/src/CSampleRuntime.cpp.o: In functionCSampleRuntime::ReadWriteIoData()‘:[cmake]: CSampleRuntime.cpp:(.text+0x19b8): undefined reference toArpPlcAxio_ReadFromAxioToGds'
[cmake]: CSampleRuntime.cpp:(.text+0x1b9c): undefined reference toArpPlcAxio_WriteFromGdsToAxio’[cmake]: CMakeFiles/PLCnextSampleRuntime.dir/src/PLCnextSampleRuntime.cpp.o: In functionmain':
[cmake]: PLCnextSampleRuntime.cpp:(.text.startup+0xca): undefined reference toArpSystemModule_Load’[cmake]: collect2: error: ld returned 1 exit status[cmake]: make[2]: *** [libPLCnextSampleRuntime.so] Error 1[cmake]: make[1]: *** [CMakeFiles/PLCnextSampleRuntime.dir/all] Error 2[cmake]: make: *** [all] Error 2cmake process exited with error` On two questions you had raised, We are planning to generate .tic files at the time application installation. We will use Process data approach.This should work fine for us.
Hi Vikash, To use those functions you will need to link to the following PLCnext libraries: Arp.Plc.AnsiC
Arp.System.ModuleLib
Arp.System.ModuleThese libraries are not included in the standard PLCnext Find modules (FindArpDevice.cmakeandFindArpProgramming.cmake). You will need to include these libraries in your build, e.g. by writing your own CMake Find module (similar to the one we made for the NE10 library in this example), or just by adding direct references to these libraries in the CMakeLists.txt file for your project. Hope this helps. Martin.
