This repository contains two .NET packages for libplctag that are published to Nuget.org:
- Package the libplctag functionality in a way that is convenient to use in .NET applications (i.e. publish on nuget.org).
- Be cross-platform: It should support any platform that libplctag can be built for, and supports .NET Standard 2.0
This is the package intended for use by application developers. It provides strongly-typed and convenient access to Tags.
For usage, see the examples in the example projects:
libplctag.NativeImport provides low-level (raw) access to the native libplctag library. The purpose of this package is to expose the native library API (which is written in C), and handle platform and configuration issues.
Documentation for the native API can be found here. An example of its usage can be found here.
During initialization, this package extracts to disk the appropriate native runtime. By default, it will overwrite any runtime that is already on disk. If you wish to disable this behaviour and use a different runtime (e.g. one that you've compiled yourself, or a pre-release), you can disable the Force Extract feature.
// Before any calls to any libplctag methods
plctag.ForceExtractLibrary = false;
The libplctag native runtime can be compiled for many platforms, and not all supported platforms are shipped with this wrapper. If you get a TypeLoadException
, chances are that you can still use this wrapper but you will need to supply the runtime yourself.