PLCnext Technology integrates programming of different languages, and enables users to create real time components in C# and C++ using their familiar Microsoft® Visual Studio® as the integrated development environment. For More information please visit our Community.
The Shared Native Examples repository is a collection of various examples for PLCnext Technology controllers. It is assumed that the reader has advanced knowledge about C# and C++ programming in general, has read the User Manual and the PLCnext Technology Quick Start Guide. Each example explains one or more topics. Specific explanations can be found in the ExampleName.md file located next to the ExampleName.cs
| # | Topic | Content |
|---|---|---|
| 01 | Data Types | Basic data types for further use. |
| 02 | Simple FB | First example for a native implementation. |
| 03 | Simple Array | Using arrays in the managed/native interface. |
| 04 | Strings | Interaction between managed and native environments regarding strings. |
| 05 | Structs | Interaction between managed and native environments regarding structs. |
| 06 | Array with Strings | Complex arrays with strings in the interaction between managed and native code. |
| 07 | Array with Structs | Complex arrays with structs in the interaction between managed and native code. |
| 08 | REAL | An example with note on how floats (REALs) are represented in the native interface. |
Find all information how to start coding for PLCnext Technology in our Info Center or watch the Youtube Playlist on our Technical Support Channel. To get started developing Shared Native Libraries, read the topic about Creating functions and function block libraries written in C++.
Most of the examples are ready to build and try with the PLCnext Toolchain Extension for Visual Studio. Follow the steps to get started:
- Make sure you have all the required installations for C# and C++.
- Open the Solution in Visual Studio.
- Setup at least one available target (recommended Firmware Version > 2025.0) via right click on the
DocuSharedNativeLibraryCppproject -->PLCnext Technology-->Set Targets. How to install target SDKs read here. - Then right click on
DocuSharedNativeLibraryCppproject -->Buildto build the library.
The ready to use PLCnext Engineer Library is now available in the C++ projects bin folder.
Note: There will be some Warnings regarding modified files which can be ignored if you didn't change the project.
You can participate in this project by submitting bugs and feature requests. Furthermore you can help us by discussing issues and let us know where you have problems or where others could struggle.
You can give feedback to this project in different ways:
- Ask a question in our Forum.
- Request a new feature on GitHub.
- Vote for Popular Feature Requests.
- File a bug in GitHub Issues.
Copyright (c) Phoenix Contact Gmbh & Co KG. All rights reserved.
Licensed under the MIT License.