L5Sharp 5.3.0

dotnet add package L5Sharp --version 5.3.0
                    
NuGet\Install-Package L5Sharp -Version 5.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="L5Sharp" Version="5.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="L5Sharp" Version="5.3.0" />
                    
Directory.Packages.props
<PackageReference Include="L5Sharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add L5Sharp --version 5.3.0
                    
#r "nuget: L5Sharp, 5.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package L5Sharp@5.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=L5Sharp&version=5.3.0
                    
Install as a Cake Addin
#tool nuget:?package=L5Sharp&version=5.3.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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 149 5/23/2025
5.2.0 87 5/23/2025
5.1.0 170 5/5/2025
5.0.0 155 5/4/2025
4.8.3 217 4/1/2025
4.8.2 171 3/31/2025
4.8.1 142 3/28/2025
4.8.0 170 2/15/2025
4.7.3 154 12/10/2024
4.7.2 146 11/28/2024
4.7.1 128 11/15/2024
4.7.0 121 11/15/2024
4.6.0 130 11/14/2024
4.5.0 134 11/11/2024
4.4.0 139 10/31/2024
4.3.0 126 10/30/2024
4.2.0 276 10/8/2024
4.1.0 124 10/7/2024
4.0.0 130 10/5/2024
3.3.1 149 9/24/2024
3.3.0 169 7/29/2024
3.2.0 159 7/7/2024
3.1.0 132 7/5/2024
3.0.0 148 6/3/2024
2.3.2 121 5/9/2024
2.3.1 481 5/6/2024
2.3.0 162 5/4/2024
2.2.1 150 4/29/2024
2.2.0 153 4/23/2024
2.1.0 140 4/18/2024
2.0.0 217 4/4/2024
0.19.7 174 3/27/2024
0.19.6 270 3/22/2024
0.19.5 161 3/9/2024
0.19.4 158 2/5/2024
0.19.3 134 2/3/2024
0.19.1 145 1/16/2024
0.19.0 126 1/16/2024
0.18.3 160 1/8/2024
0.18.2 143 1/4/2024
0.18.1 138 12/29/2023
0.18.0 193 12/9/2023
0.17.0 175 12/8/2023
0.16.1 143 11/28/2023
0.16.0 140 11/28/2023
0.15.2 226 8/18/2023
0.15.1 180 8/17/2023
0.15.0 233 8/16/2023
0.14.0 241 8/9/2023
0.13.0 238 8/6/2023
0.12.0 211 8/1/2023
0.11.0 203 7/12/2023
0.10.1 277 3/31/2023
0.10.0 246 3/31/2023
0.9.2 248 3/24/2023
0.9.1 262 3/15/2023
0.9.0 266 3/15/2023
0.8.0 268 3/15/2023
0.7.0 252 3/14/2023
0.6.0 257 3/14/2023
0.5.3 262 3/13/2023
0.5.2 256 3/13/2023
0.5.0 261 3/13/2023
0.4.0 269 3/12/2023
0.3.0 271 3/5/2023
0.2.0 328 3/1/2023