SoftBetaMxLogix 1.1.8

dotnet add package SoftBetaMxLogix --version 1.1.8
                    
NuGet\Install-Package SoftBetaMxLogix -Version 1.1.8
                    
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="SoftBetaMxLogix" Version="1.1.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SoftBetaMxLogix" Version="1.1.8" />
                    
Directory.Packages.props
<PackageReference Include="SoftBetaMxLogix" />
                    
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 SoftBetaMxLogix --version 1.1.8
                    
#r "nuget: SoftBetaMxLogix, 1.1.8"
                    
#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 SoftBetaMxLogix@1.1.8
                    
#: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=SoftBetaMxLogix&version=1.1.8
                    
Install as a Cake Addin
#tool nuget:?package=SoftBetaMxLogix&version=1.1.8
                    
Install as a Cake Tool

SoftBetaMX Logix Core

A powerful .NET library for communicating with Allen-Bradley MicroLogix PLCs

NuGet Version NuGet Downloads License: MIT .NET

Simplify industrial automation with easy-to-use PLC communication in .NET

Installation

Using .NET CLI

dotnet add package SoftBetaMxLogix

Using Package Manager Console

Install-Package SoftBetaMxLogix

Requirements

  • .NET 6.0 or higher
  • Allen-Bradley MicroLogix PLC
  • Network connectivity to PLC

Quick Start

Connect to PLC

using SoftBetaMxLogix;

// Connect to PLC at 192.168.0.100 with 5 second timeout
var plc = new logix("192.168.0.100", 5000);

Read Data from PLC

// Read integer from N7:0
string intValue = plc.read("N7:0");
Console.WriteLine($"N7:0 value: {intValue}");

// Read bit from B3:0
string bitValue = plc.read("B3:0");
Console.WriteLine($"B3:0 value: {bitValue}");

Write Data to PLC

// Write to output O:0/0
plc.write("O:0/0", "1");  // Turn ON

// Write to bit B3:0
plc.write("B3:0", "0");  // Turn OFF

// Write to integer N7:0
plc.write("N7:0", "100");

Work with Timers

// Read timer preset value
string timerPre = plc.readTimer("T4:0", logix.dataTimer.PRE);
Console.WriteLine($"Timer T4:0 PRE: {timerPre}");

// Read timer accumulated value
string timerAcc = plc.readTimer("T4:0", logix.dataTimer.ACC);
Console.WriteLine($"Timer T4:0 ACC: {timerAcc}");

Features

Easy PLC Connection

  • Simple IP-based connection with configurable timeout
  • Automatic protocol handling via libplctag
  • Built-in connection management

Read/Write Operations

  • Read PLC tags: Integer, Boolean, Timer, Counter values
  • Write PLC tags: Update outputs, bits, and data registers
  • Multiple data types: N, B, T, C, O, I file types
  • Type-safe operations with automatic data handling

Timer Support

  • Read timer PRE (preset) values
  • Read timer ACC (accumulated) values
  • Easy timer monitoring and control

Robust & Reliable

  • Built-in timeout and error handling
  • Production-tested in industrial environments
  • Full XML documentation for IntelliSense

Usage Examples

Example 1: Monitor Multiple Tags

using SoftBetaMxLogix;

var plc = new logix("192.168.0.100", 5000);

while (true)
{
    string temp = plc.read("N7:10");  // Temperature sensor
    string level = plc.read("N7:11"); // Level sensor
    string motor = plc.read("B3:0");  // Motor status
    
    Console.WriteLine($"Temp: {temp}C, Level: {level}%, Motor: {(motor == "1" ? "ON" : "OFF")}");
    
    Thread.Sleep(1000);
}

Example 2: Control Production Line

using SoftBetaMxLogix;

var plc = new logix("192.168.0.100", 5000);

// Start production line
plc.write("O:0/0", "1");  // Conveyor motor
plc.write("O:0/1", "1");  // Indicator light
plc.write("N7:20", "150"); // Set target speed

Console.WriteLine("Production line started");

// Monitor until complete
while (plc.read("B3:5") != "1")  // Wait for complete signal
{
    string progress = plc.read("N7:21");
    Console.WriteLine($"Progress: {progress}%");
    Thread.Sleep(500);
}

// Stop production line
plc.write("O:0/0", "0");
plc.write("O:0/1", "0");
Console.WriteLine("Production line stopped");

Example 3: Timer Monitoring

using SoftBetaMxLogix;

var plc = new logix("192.168.0.100", 5000);

string preset = plc.readTimer("T4:0", logix.dataTimer.PRE);
Console.WriteLine($"Cycle time set to: {preset} seconds");

while (true)
{
    string elapsed = plc.readTimer("T4:0", logix.dataTimer.ACC);
    int percentage = (int)((double.Parse(elapsed) / double.Parse(preset)) * 100);
    
    Console.WriteLine($"Cycle progress: {percentage}% ({elapsed}/{preset}s)");
    
    Thread.Sleep(100);
}

API Reference

Constructor

public logix(string ip, int timeout)

Parameters:

  • ip - IP address of the PLC (e.g., "192.168.0.100")
  • timeout - Connection timeout in milliseconds (default: 5000)

Methods

Read Tag
public string read(string tagName)

Reads a value from the specified PLC tag.

Supported tag types:

  • N7:x - Integer files
  • B3:x - Binary/Bit files
  • T4:x - Timer files
  • C5:x - Counter files
  • O:x/x - Output files
  • I:x/x - Input files
Write Tag
public void write(string tagName, string value)

Writes a value to the specified PLC tag.

Parameters:

  • tagName - The PLC tag address
  • value - The value to write (as string)
Read Timer
public string readTimer(string tagName, dataTimer dataType)

Reads timer preset (PRE) or accumulated (ACC) values.

Parameters:

  • tagName - Timer tag address (e.g., "T4:0")
  • dataType - logix.dataTimer.PRE or logix.dataTimer.ACC

Configuration

Timeout Settings

var plc = new logix("192.168.0.100", 5000);  // 5 second timeout

// Or modify timeout after creation
plc.Timeout = 10000;  // 10 second timeout

Error Handling

try
{
    var plc = new logix("192.168.0.100", 5000);
    string value = plc.read("N7:0");
}
catch (Exception ex)
{
    Console.WriteLine($"PLC communication error: {ex.Message}");
}

Support

Need help? Contact us:

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.


Made with love by SoftBetaMX

Copyright 2026 SoftBetaMX. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.8 95 2/1/2026
1.1.6 102 1/31/2026
1.1.4 91 1/31/2026
1.1.3 92 1/31/2026
1.1.2 100 1/31/2026
1.1.0 1,006 2/23/2022
1.0.9 849 2/23/2022

v1.1.8: Multi-targeting support for .NET 6.0, 8.0, and 10.0