Skip to content

PLCnext/SharedNativeExamples

PLCnext Technology - Shared Native Examples

Feature Requests Bugs License Web Community

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

Table of Content

# 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.

Getting Started

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++.

Building Shared Native Example Project

Most of the examples are ready to build and try with the PLCnext Toolchain Extension for Visual Studio. Follow the steps to get started:

  1. Make sure you have all the required installations for C# and C++.
  2. Open the Solution in Visual Studio.
  3. Setup at least one available target (recommended Firmware Version > 2025.0) via right click on the DocuSharedNativeLibraryCpp project --> PLCnext Technology --> Set Targets. How to install target SDKs read here.
  4. Then right click on DocuSharedNativeLibraryCpp project --> Build to 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.

Contributing

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.

Feedback

You can give feedback to this project in different ways:

License

Copyright (c) Phoenix Contact Gmbh & Co KG. All rights reserved.

Licensed under the MIT License.

About

Collection of various shared native example code for PLCnext Technology controllers.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors