L5Sharp 5.3.0
dotnet add package L5Sharp --version 5.3.0
NuGet\Install-Package L5Sharp -Version 5.3.0
<PackageReference Include="L5Sharp" Version="5.3.0" />
<PackageVersion Include="L5Sharp" Version="5.3.0" />
<PackageReference Include="L5Sharp" />
paket add L5Sharp --version 5.3.0
#r "nuget: L5Sharp, 5.3.0"
#:package L5Sharp@5.3.0
#addin nuget:?package=L5Sharp&version=5.3.0
#tool nuget:?package=L5Sharp&version=5.3.0
L5Sharp
A .NET library for interacting with Rockwell's L5X import/export files.
Overview
L5Sharp is designed to provide an intuitive and strongly-typed interface for working with Rockwell Automation's L5X import/export files. This library enables developers and automation engineers to easily read, query, modify, and generate L5X content programmatically.
Features
- Simple and Intuitive API: Class and property names should be familiar to Rockwell PLC developers.
- Multi-target Framework Support: Compatible with .NET Standard 2.0 and .NET 8.0
- Strongly-typed Component Model: Work with tags, programs, rungs, and other Logix components in a type-safe manner
- Powerful Querying Capabilities: Leverage LINQ to perform complex queries across your L5X content
- Efficient Component Indexing: Fast lookups with indexed components for performance-critical operations
- Component Modification: Add, remove, update, or replace components with ease
- Mutable Tag Data: Reference and modify complex tag structures statically at compile time
- Extensible Architecture: Seamlessly extend the API to support custom queries or functions
Installation
Install L5Sharp from NuGet:
Install-Package L5Sharp
Quick Start
Load an Existing L5X File
// Load an L5X file
var content = L5X.Load("C:\\PathToMyFile\\FileName.L5X");
Query L5X Components
// Get all controller tags
var tags = content.Tags.ToList();
// Find a specific tag by name
var myTag = content.Tags.Find("MyTag");
// Query all TIMER tags across the entire project
var timerTags = content.Query<Tag>()
    .Where(t => t.DataType == "TIMER")
    .ToList();
// Query nested tag members
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();
Fast Component Lookup
To index the L5X on load or parse, you must supply the L5XOptions.Index.
var content = L5X.Load("MyTestFile.L5X", L5XOptions.Index);
Then use ILogixLookup API Get, TryGet, Find, or Contains.
// Get controller scoped tag.
Tag controlelrTag = content.Get<Tag>("MyTagName")
// Get program scoped tag.
Tag programTag = content.Get<Tag>("/MyProgram/Tag/MyTagName")
// Find all tags with name (could be in multiple different programs).
IEnumerable<Tag> tags = content.Find<Tag>("MyTagName")
// Get a nested controller tag member
Tag tagMember = content.Get<Tag>("MyTag.Member[1].SubMember.1");
// Try get single tag.
var result = content.TryGet("/Tag/MyTagName", out var tag);
Modify L5X Content
// Create and add a new tag
var newTag = new Tag { Name = "MyTag", Value = 100 };
content.Tags.Add(newTag);
// Remove a tag
content.Tags.Remove("OldTag");
// Modify tag properties
var tag = content.Tags.Find("ExistingTag");
tag.Value = 50;
tag.Description = "Updated tag description";
tag.ExternalAccess = ExternalAccess.ReadOnly;
// Bulk update components
content.Tags.Update(
    t => t.DataType == "TIMER", //update condition
    t => t.Description = "Updated TIMER description" //update action
);
// Save changes
content.Save("C:\\PathToMyOutputFile\\UpdatedFile.L5X");
Component Types
L5Sharp provides support for all primary Logix components:
- Controller
- DataType
- AddOnInstruction
- Module
- Tag
- Program
- Routine
- Task
- Trend
- WatchList
Use Cases
- Automation of PLC development tasks
- Consistency checks across multiple PLC projects
- Tag documentation and reporting
- PLC code generation
- Automation tool development.
DeepWiki Documentation
DeepWiki is an AI-powered platform that automatically generates comprehensive, Wikipedia-style documentation for any public GitHub repository, complete with interactive diagrams and a conversational assistant to answer technical questions about the codebase. (From Perplexity)
https://deepwiki.com/tnunnink/L5Sharp
Requirements
- .NET Standard 2.0 or .NET 8.0 compatible framework
- C# 12.0 support
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! If you find issues or have suggestions for improvements, please create an issue or submit a pull request to the GitHub repository.
Feedback
If you find this library useful, please consider leaving a star on the GitHub repository. Any feedback or questions can be submitted via the issues section.
| 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 is compatible. 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. | 
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. | 
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. | 
| MonoAndroid | monoandroid was computed. | 
| MonoMac | monomac was computed. | 
| MonoTouch | monotouch was computed. | 
| Tizen | tizen40 was computed. 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.0- No dependencies.
 
- 
                                                    net8.0- No dependencies.
 
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 | 334 | 5/23/2025 | 
| 5.2.0 | 122 | 5/23/2025 | 
| 5.1.0 | 215 | 5/5/2025 | 
| 5.0.0 | 198 | 5/4/2025 | 
| 4.8.3 | 267 | 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 | 169 | 11/11/2024 | 
| 4.4.0 | 187 | 10/31/2024 | 
| 4.3.0 | 171 | 10/30/2024 | 
| 4.2.0 | 403 | 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 | 182 | 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 | 211 | 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 | 247 | 7/12/2023 | 
| 0.10.1 | 327 | 3/31/2023 | 
| 0.10.0 | 300 | 3/31/2023 | 
| 0.9.2 | 296 | 3/24/2023 | 
| 0.9.1 | 304 | 3/15/2023 | 
| 0.9.0 | 306 | 3/15/2023 | 
| 0.8.0 | 318 | 3/15/2023 | 
| 0.7.0 | 291 | 3/14/2023 | 
| 0.6.0 | 307 | 3/14/2023 | 
| 0.5.3 | 303 | 3/13/2023 | 
| 0.5.2 | 285 | 3/13/2023 | 
| 0.5.0 | 310 | 3/13/2023 | 
| 0.4.0 | 310 | 3/12/2023 | 
| 0.3.0 | 322 | 3/5/2023 | 
| 0.2.0 | 381 | 3/1/2023 |