SoftBetaMxLogix 1.1.8
dotnet add package SoftBetaMxLogix --version 1.1.8
NuGet\Install-Package SoftBetaMxLogix -Version 1.1.8
<PackageReference Include="SoftBetaMxLogix" Version="1.1.8" />
<PackageVersion Include="SoftBetaMxLogix" Version="1.1.8" />
<PackageReference Include="SoftBetaMxLogix" />
paket add SoftBetaMxLogix --version 1.1.8
#r "nuget: SoftBetaMxLogix, 1.1.8"
#:package SoftBetaMxLogix@1.1.8
#addin nuget:?package=SoftBetaMxLogix&version=1.1.8
#tool nuget:?package=SoftBetaMxLogix&version=1.1.8
SoftBetaMX Logix Core
A powerful .NET library for communicating with Allen-Bradley MicroLogix PLCs
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 filesB3:x- Binary/Bit filesT4:x- Timer filesC5:x- Counter filesO:x/x- Output filesI: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 addressvalue- 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.PREorlogix.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}");
}
Links
Support
Need help? Contact us:
- Email: soporte@softbetamx.com
- Issues: GitHub Issues
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 | Versions 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. |
-
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.
v1.1.8: Multi-targeting support for .NET 6.0, 8.0, and 10.0