L5Sharp 0.16.0
See the version list below for details.
dotnet add package L5Sharp --version 0.16.0
NuGet\Install-Package L5Sharp -Version 0.16.0
<PackageReference Include="L5Sharp" Version="0.16.0" />
<PackageVersion Include="L5Sharp" Version="0.16.0" />
<PackageReference Include="L5Sharp" />
paket add L5Sharp --version 0.16.0
#r "nuget: L5Sharp, 0.16.0"
#:package L5Sharp@0.16.0
#addin nuget:?package=L5Sharp&version=0.16.0
#tool nuget:?package=L5Sharp&version=0.16.0
L5Sharp
A library for intuitively interacting with Rockwell's L5X import/export files.
Purpose
The purpose of this library is to offer a reusable, strongly typed, intuitive API over Rockwell's L5X schema, allowing developers to quickly modify or generate L5X content. In doing so, this library can aid in creation of tools or scripts that automate the PLC development, maintenance, or testing processes for automation engineers.
Goals
The following are some high level goals this project aimed to accomplish.
- Provide a simple and intuitive API, making the learning curve as low as possible.
- Ensure performance as much as possible without sacrificing simplicity.
- Make it easy and seamless to extend the API to support custom queries or functions.
- Support strongly typed mutable tag data, so we can reference complex structures statically at compile time.
Packages
You cna consume the library via Nuget.
Install-Package L5Sharp
Previously I had two separate libraries but have since consolidated to a single package to avoid confusion and since I think most people will want all functionality anyway.
L5Sharp.Extensionsis no longer maintained.
Quick Start
Install package from Nuget.
Install-Package L5SharpLoad an L5X file using the
L5Xclass static factory method like so.var content = L5X.Load("C:\PathToMyFile\FileName.L5X");Get started by querying elements across the L5X using the
Query()methods and LINQ extensions. The following query gets all tags and their nested tag members of type TIMER and returns the TagName, Description, and Preset value in a flat list ordered by TagName.var results = content.Query<Tag>() .SelectMany(t => t.Members()) .Where(t => t.DataType == "TIMER") .Select(t => new {t.TagName, t.Description, Preset = t["PRE"].Value}) .OrderBy(v => v.TagName) .ToList();Query<T>()returns anIEnumerable<T>, allowing for complex queries using LINQ and the strongly typed objects in the library. SinceQuery<T>()queries the entire L5X for the specified type, the above query will return all Tag components found, including controller and program tags.
Usage
The following is some basic examples of how you can use this library to query and modify the L5X content.
Querying
Once the LogixContent is created, you can use the container properties
to get access to all of the primary L5X components,
such as Tag, DataType, Module, Program, and more.
The following shows some simple querying via the Tags component container.
//Get all controller tags.
var tags = content.Tags.ToList();
//Get a tag by name.
var tag = content.Tags.Find("MyTag");
//Use LINQ to query further.
var results = content.Tags.Where(t => t.DataType == "TIMER");
Modifying
Modifying components is simple as well. The same component collection interface offers methods for adding, removing, and updating components.
//Add a new component.
var tag = new Tag { Name = "MyTag", Value = 100 };
content.Tags.Add(tag);
//Remove an existing component.
var result = content.Tags.Remove("MyTag");
//Repalce an existing component.
var result = content.Tags.Find("MyTag").Replace(tag);
//Configure individual properties.
var tag = content.Tags.Get("MyTag");
tag.Value = 100;
tag.Description = "This is an update";
tag.ExternalAccess = ExternalAccess.ReadOnly;
tag.Constant = true;
//Apply update funtion to all components that satisfy a condition.
content.Tags.Update(t => t.DataType == "TIMER", t => t.Description = "Updated TIMER description");
//Save changes when done.
content.Save("C:\PathToMyOutputFile\FileName.L5X");
Documentation
See my GitHub Page here for more in depth articles and API documentation. The documentation is always a work in progress. If you think something is unclear or can be improved upon, feel free to let me know in the issues tab of the project repository.
Feedback
If you like or use this project, leave a star. If you have questions or issues, please post in the issues tab of the project repository. Any feedback is always appreciated. Enjoy!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- JetBrains.Annotations (>= 2023.2.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on L5Sharp:
| Package | Downloads |
|---|---|
|
L5Sharp.Logix
Adds support to load L5X files from ACD file using Logix SDK. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.3.0 | 359 | 5/23/2025 |
| 5.2.0 | 122 | 5/23/2025 |
| 5.1.0 | 216 | 5/5/2025 |
| 5.0.0 | 199 | 5/4/2025 |
| 4.8.3 | 268 | 4/1/2025 |
| 4.8.2 | 216 | 3/31/2025 |
| 4.8.1 | 189 | 3/28/2025 |
| 4.8.0 | 215 | 2/15/2025 |
| 4.7.3 | 199 | 12/10/2024 |
| 4.7.2 | 188 | 11/28/2024 |
| 4.7.1 | 170 | 11/15/2024 |
| 4.7.0 | 163 | 11/15/2024 |
| 4.6.0 | 171 | 11/14/2024 |
| 4.5.0 | 170 | 11/11/2024 |
| 4.4.0 | 187 | 10/31/2024 |
| 4.3.0 | 171 | 10/30/2024 |
| 4.2.0 | 419 | 10/8/2024 |
| 4.1.0 | 167 | 10/7/2024 |
| 4.0.0 | 172 | 10/5/2024 |
| 3.3.1 | 191 | 9/24/2024 |
| 3.3.0 | 210 | 7/29/2024 |
| 3.2.0 | 194 | 7/7/2024 |
| 3.1.0 | 177 | 7/5/2024 |
| 3.0.0 | 183 | 6/3/2024 |
| 2.3.2 | 280 | 5/9/2024 |
| 2.3.1 | 529 | 5/6/2024 |
| 2.3.0 | 205 | 5/4/2024 |
| 2.2.1 | 185 | 4/29/2024 |
| 2.2.0 | 195 | 4/23/2024 |
| 2.1.0 | 182 | 4/18/2024 |
| 2.0.0 | 260 | 4/4/2024 |
| 0.19.7 | 216 | 3/27/2024 |
| 0.19.6 | 304 | 3/22/2024 |
| 0.19.5 | 195 | 3/9/2024 |
| 0.19.4 | 202 | 2/5/2024 |
| 0.19.3 | 175 | 2/3/2024 |
| 0.19.1 | 190 | 1/16/2024 |
| 0.19.0 | 166 | 1/16/2024 |
| 0.18.3 | 201 | 1/8/2024 |
| 0.18.2 | 186 | 1/4/2024 |
| 0.18.1 | 159 | 12/29/2023 |
| 0.18.0 | 235 | 12/9/2023 |
| 0.17.0 | 216 | 12/8/2023 |
| 0.16.1 | 170 | 11/28/2023 |
| 0.16.0 | 170 | 11/28/2023 |
| 0.15.2 | 268 | 8/18/2023 |
| 0.15.1 | 212 | 8/17/2023 |
| 0.15.0 | 276 | 8/16/2023 |
| 0.14.0 | 270 | 8/9/2023 |
| 0.13.0 | 277 | 8/6/2023 |
| 0.12.0 | 241 | 8/1/2023 |
| 0.11.0 | 248 | 7/12/2023 |
| 0.10.1 | 329 | 3/31/2023 |
| 0.10.0 | 302 | 3/31/2023 |
| 0.9.2 | 298 | 3/24/2023 |
| 0.9.1 | 306 | 3/15/2023 |
| 0.9.0 | 308 | 3/15/2023 |
| 0.8.0 | 320 | 3/15/2023 |
| 0.7.0 | 293 | 3/14/2023 |
| 0.6.0 | 309 | 3/14/2023 |
| 0.5.3 | 305 | 3/13/2023 |
| 0.5.2 | 287 | 3/13/2023 |
| 0.5.0 | 312 | 3/13/2023 |
| 0.4.0 | 312 | 3/12/2023 |
| 0.3.0 | 324 | 3/5/2023 |
| 0.2.0 | 383 | 3/1/2023 |
Initial release.