Some weeks ago, I participated in a basic presentation of PLCNext technology. And it has potential to be amazing! On this presentation, in a few minutes that I have to test it, I was able to load and run into a AXL F 2152 (via SFTP/WinSCP/SSH) a small program write in FreePascal (designed to run into a Cubieboard 2). My question is: Someone besides me already tried this? Someone using a program running directly on Linux OS of the AXL F 2152 was able to access Inputs and outputs on the Axioline bus? I believe that this is possible, since that the “PLC program” runs over a Mono/.Net application that runs as service over the Linux OS. Yes, I known that using this method (program running directly into Linux OS) I’ll lose (or I have to implement these) many features, like profinet, proficloud…
Hi Fabio, thank you for your post and we are pleased that you already can imagine how many different kinds of applications could be possible. With the current version it is unfortunately not possible to directly access the local IO, we will implement a direct access with the next “bigger” firmware version (2.0) in november.
This API will allow to access the IO also from applications running in other Linux processes.
For now you’ve to use a workaround in terms that an ESM C++ program implements an interface (like REST) to transfer the datas. Have a nice weekend!
Hi @Frank! Yesterday (21-ago-2018) I received an AXL F 2152 to test. And now, I have the time to do everything that I want. I see that the .Net/Mono process has some devices open, such as /dev/axio_xfer0 (that I can imagine as the Axioline communication bus, loaded through a Linux kernel module provided by Phoenix Contact). I don’t want to wait for the firmware 2.0 be released (because I’ll no have the AXL F 2152 in November, my test period expires in September). So, is the /dev/axio_xfer0 the device that represents the Axioline bus? Or the I/O access is done via /dev/mem? Can the Phoenix Contact provide a small C/C++ example of how access the Axioline bus directly, without wait the firmware 2.0 be released? I have done some progress, reading some sensors (temperature and humidity) and LEDs from AXL F 2152, but my main target is to access the Axioline bus directly…
Hi Fabio, pity that the new firmware comes too late for you. ![]()
With FW 1.0 you’ve to go a workaround, one could be to implement as C++ PLCnext program a REST interface as a bride to the IO. A few colleagues of mine did this a few month before, they alredy post the solution in this forum, but unfortunately it gets lost during the server crash. However, I’ll ask them to post the solution onces again, please give me a few days. cu Frank
Hi Fabio,
as Frank has previously written, a direct access to the IO data outside of PLCnext is currently not possible. In order to access the data of the AXIO bus, it is currently necessary to make the detour via a separate interface that is supported both by PLCnext and by the external application.
As a REST interface we can recommend the REST SDK from Microsoft. This is excellently described and relatively easy to port to the controller. C+±REST-SDK (Codename “Casablanca”) The sources include a CMake toolchain that can be easily used with the provided toolchain files. To connect the IOs, mechanisms of PLCnext in C ++ must be used (GDS + AddPortInfo or Subscriptions) and mapped accordingly to the self-implemented interface.
Alternatively, we have had good experiences with the zeromq framework. With zeromq you can build a socket-based communication to exchange data between applications. ZeroMQ Unfortunately, we do not have any code that we can provide, but I hope the information helps at least a little further.
Hi Frank, Marcel! Sorry for taking to much time to reply. So, your suggestion is, basically, use the PC Worx to:
* Configure the Axioline bus; * Develop a small lib that will read/write IO's via a REST/ZeroMQ library and load it into PLCNext using PC Worx; * Develop into my app an interface to communicate with PLC software through interface chosen.If yes, I think this approach has some advantages, such as accessing IO’s in Profinet devices, right? The disadvantage is that if IO image changes (adding or removing some IO board), I must update my project and my library to reflect the new IO image. But knowing that:
* I want to access only the IO in the Axioline bus of the PLCNext (I don’t want access IO’s on the Profinet bus);
* I know about the existence of the libaxio.so and their methods/functions, that suggests that this library handles the Axioline bus.
* I know about the existence of the kernel module, loaded at startup, authorship Phoenix Contact, that I can Imagine is the bridge between the Axioline bus (hardware) and libaxio.so.
Since the PLC software (developed in PC Worx) is loaded and executed by a Linux application, that runs at startup as a service, why my app can’t do the same? The question is: The Phoenix Contact can share information about this lib/kernel module? OR NOT, information on this library/kernel module are properties of Phoenix Contact and cannot be shared? OR NOT, writing your own app in this way will unlock much more power, such as processing and memory capabilities? If it can be shared, please let me do a try…
Hi Fabio, Your description of the three steps is correct, but it is only necessary to use PC Worx Engineer for the first step:
1. Using PC Worx Engineer, the I/O configuration must be prepared and downloaded . This creates the files that the AXC F 2152 needs to communicate with Axioline I/O modules (if any) and Profinet I/O devices (if any). 2. Using Eclipse and the PLCnext plug-in, you can develop a small program that will read/write IO's on the Axioline bus, and then expose this I/O data via a REST/ZeroMQ interface. This does not require PC Worx Engineer - your C/C++ program can be copied to the PLC using WinSCP (for example), and then scheduled to run on the ESM simply by editing the relevant XML files. These steps are described in [this Commuity article](https://plcnext-community.net/index.php?option=com_content&view=article&id=249:c-deployment-with-eclipse-without-pc-worx-engineer&catid=35&Itemid=232&lang=en). 3. Your FreePascal app can then communicate with your C/C++ app using the REST/ZeroMQ interface.You are correct, this method has the disadvantage that new I/O must be configured in PC Worx Engineer. This new I/O configuration may break your C/C++ code … depending on how you write it. It is possible for the C/C++ code to read the I/O configuration from the TIC files on startup, and then re-configure its GDS connections to the new I/O accordingly. As mentioned in other replies, there is likely to be a more direct solution available with the release of the next major firmware version. Whether this involves the direct use of the libaxio.so shared library, I cannot say, since I don’t have this information yet. I completely understand your point about how useful direct access to Axioline I/O will be - there are already many customers asking for this feature - which is one reason why it is scheduled for the next frmware release. Unfortunately there is not likely to be any detailed technical information for this feature available until next month. - Martin.
Hi Marcel! Can anyone inside of Phoenix Contact share the libaxio.so methods signatures (the libaxio .h file)? Or this information is confidential? The best regards, Fabio
Hello Fabio, I’ve checked internally here and I’m afraid that we’re not able to share details of the libaxio.so method signatures. - Martin.
Hi @Frank, @Marcel and @Martin! Some news about Firmware 2.0? FW 2.0 was planned to be released in november/2018. Now (january/2019) I don’t see it in the firmware download page. Some news? Is the FW 1.20 the firmware that was planned to be released in November? The best regards, Fabio
Hello Fabio, There was a delay in the release of the firmware that was planned for November 2018. We are expecting the next major firmware release for the AXC F 2152 at the end of February. This will have the version number 2019.0. The current version of firmware is 1.20. - Martin.
Just updating this thread in case there are any other FreePascal users out there who want to use FreePascal with PLCnext Control. There is now an example of how to access Axioline I/O using the PLCnext ANSI-C library: https://github.com/PLCnext/SampleRuntime The example is written in C++ but the idea is the same for any language that can use ANSI-C libraries … which I assume includes FreePascal. Any questions, please ask.
YYYYYYYYYYYEEEEESSSSSSSSSSSS!!! Thanks!! I’ll test and report. Many thanks!
Enjoy
Please note that the PLCnext ANSI-C library is used in parts 2, 3, and 4 of the tutorial series, so you should be able to reproduce these functions using FreePascal. Most of the remaining parts of the series use PLCnext C++ libraries, which may or may not be useable with FreePascal. Part 5 uses the “pthread” system library to create real-time threads - it should be possible to use this system library with FreePascal, somehow. If you have success with this then it would be an interesting topic for a Makers Blog article. - Martin.
Hi All!
Sample runtime 3, has the following note:
“An important point to note is that, in this project, I/O data is transferred automatically from the GDS to Axioline I/O modules every 500μs. This should be considered for real-time tasks with very short cycle times (in the order of milliseconds).”
The value of 500μs is a constant? Can I change this value?
Hi again!
If the reply for the previous question is NO and I can’t change the 500μs transfer rate to a smaller value, is possible to change the “cycleTime” attribute on file /opt/plcnext/projects/PCWE/Plc/Esm/PCWE.esm.config to values smaller than 1ms, by example 100μs? Or the runtime is internally hardcoded to minimal 1ms cycle times?
The value of 500μs is a constant?Yes, if the I/O cycle time is not synchronised with an ESM user task, then this is the default I/O cycle time.
Can I change this value?Not without linking the I/O update time to an ESM user task.
is possible to change the “cycleTime” attribute on file /opt/plcnext/projects/PCWE/Plc/Esm/PCWE.esm.config to values smaller than 1ms, by example 100μs?In theory, yes. The values in this file can also be changed in the PLCnext Engineer project, but in PLCnext Engineer there is a lower limit enforced on the task interval. It is not recommended to bypass the lower limit enforced by PLCnext Engineer, because then you will probably not get deterministic task cycle times.
Hi Martin!
I’ll do some tests, I need to get more weigth mensuraments per second as possible, but the SGI2 IO module has a internal response limitation of 200μs so isn’t very usefull get higher rates (lower intervals) due this.
I got a new AXC F 1152 and I was able to manage their settings to run PLCNext Engineer program every 500μs. It’s a simple program, that enables a Modbus TCP Server, a 1 second timer and a Add instruction, to check if my program is really running at 500uS. Please don’t block this “feature” . To me, the freedom of to do things that PLCNext isn´t designed to do, is the their best feature. BTW, this way loses the PLC determinism, I know about this and this are just tests.
Soon as possible, I’ll try do the same using the Sample 3.
I’ll repeat these tests when I got another 2152 PLC.