- Introduction
- Guide details
- When to use Internal Function Extensions
- Limitations
- Quick-start example
- IMPORTANT NOTE on acyclic communication service
The Internal Function Extensions allows to access the I/O Data, GDS(Global Data Space) and using of services provided by the PLCnext Control platform (e.g. RSC services).
Description | Value |
---|---|
Created | 15.11.2019 |
Last modified | 18.11.2019 |
Controller | AXC F 2152 |
FW | 2019.9 |
Arpversion | 19.9.0.23151 |
SVN Revision | 23151 |
SDK | 19.9.0.23151 |
PLCnext CLI | 2020.0 LTS |
Internal Function Extensions are useful when non-real-time data must be processed on a PLCnext Control, e.g.:
- if your application needs deterministic real-time capability and non-real-time capability, you can divide your application in two parts for optimization of CPU resources
- if you use RSC services for data access on GDS (Global Data Space) data and/or on Axioline I/O data in non-real-time context
- to configure Axioline modules.
Internal Function Extensions are not designed to operate in a real-time context.
This example demonstrates features of Internal Function Extensions.
An ACF component is created which should fulfill the following tasks:
- Axioline PDI data should be read via RSC and be written to the diagnostic log file.
- The data to be read can be specified in a JSON configuration file.
- The selection of the module that provides the PDI data can be set via the process data inputs of the Axioline module. On the PLCnext Starter Kit, the process data inputs are connected to a switch module. If e.g. the second Axioline module has to provide data, the switch 1 must be set to true, because this results in binary two.
-
Starterkit - AXC F 2152 STARTERKIT (Order Number: 1046568)
-
PLCnext Command Line Interface (CLI) tool, version 2020.0 LTS. This is included in the "PLCnext Technology C++ tool chain", available on the Phoenix Contact website.
-
Software Development Kit (SDK) for the AXC F 2152 PLCnext Control, version 2019.9. This is available on the Phoenix Contact website, and must be installed using the PLCnext CLI.
-
PLCnext Engineer version 2019.9.
-
WinSCP or a similar software, incl. PuTTY
- Please exercise the e-learning "Internal Function Extensions"
- Establish the communication between PLCnext Control and computer.
- Create a PLCnext Engineer project
Proj_BusConfig.pcwex
with busconfigurationAXL F DI8/1 DO8/1 1H
as first axioline modul and (optional)AXL F AI2 AO2 1H
as second axioline modul. - Load the PLCnext Engineer project onto the PLCnext Control.
- Download the RapidJSON library from repository: RapidJSON and unzip it.
- RapidJSON is a header-only C++ library, just copy the
include/rapidjson
folder to the SDK folder on your computersysroots/cortexa9t2hf-neon-pxc-linux-gnueabi/usr/include
. - In Eclipse® create a ACF-Project
LIB_AxioRead
with componentCOMP_AxioRead
. - In the project replace the files
COMP_AxioRead.cpp
andCOMP_AxioRead.hpp
with files contained in thesrc
directory of this repository. - Refresh and compile the
LIB_AxioRead
Eclipse® project. - Use WinSCP to establish an SFTP connection with PLCnext Control.
- Find the shared object
libLIB_AxioRead.so
in an Eclipse® workspace directory e.g.LIB_AxioRead\bin\AXCF2152_19.9.0.23151\Release\lib
and copy it to the/opt/plcnext/projects/Components
PLC's directory. - Copy the “AxioReadConfig.schema.json” and the “AxioReadConfig.json” file (contained in the
data
directory of this repository) to the/opt/plcnext/projects/Components
PLC's directory. - Copy the
LIB_AxioReadLibrary.acf.config
file (contained in thedata
directory of this repository) to the/opt/plcnext/projects/Default
PLC's directory. All.acf.config
files in this directory are processed by the ACF when the plcnext process starts up. - Restart the PLCnext process via command line
sudo /etc/init.d/plcnext restart
in the PuTTY terminal. - Check that your application has started successfully by changing the DI-Signals on
AXL F DI8/1 DO8/1 1H
mudul and examining the PLCnext log file:/opt/plcnext/logs/Output.log
.
- If you think about using the "PdiRead" and "PdiWrite" methods of pAcyclicCommunicationService to transfer the process data to the real-time application - please don't!
- For applications that need real-time access to I/O data, the easiest and fastest way is to create your C++ application in the PLCnext Technology Eclipse® Add-in - using PLCnext components, programs and port variables from the template for real-time applications.
- If the access to the real-time process data is required for external application running directly on the Linux OS, then the best solution is to use the Sample Runtime example, which is designed especially for this purpose.