DBI.Drivers.Omron 1.0.0

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

DBI.Drivers.Omron

Thư viện giao tiếp PLC Omron qua giao thức FINS (Factory Interface Network Service) cho .NET 8.

Liên kết

Tính năng

  • FINS/TCP — Giao tiếp qua Ethernet (port 9600)
  • 8 vùng nhớ — DM, CIO, WR, HR, AR, EM, TIM, CNT
  • Nhiều kiểu dữ liệu — Word (Int16), DWord (Int32), Float (IEEE 754), BCD, String
  • Thread-safe — SemaphoreSlim bảo vệ truy cập FINS master
  • Auto-reconnect — Tự kết nối lại khi mất kết nối
  • Generic API — Đọc/ghi bằng địa chỉ chuỗi: "DM100", "CIO0", "WR50"

Cài đặt

dotnet add package DBI.Drivers.Omron

Sử dụng nhanh

using DBI.Drivers.Omron;

// Kết nối FINS/TCP
var plc = new OmronClient("192.168.1.10", 9600);
plc.AutoReconnect = true;
plc.Connect();

// Đọc/Ghi DM (Data Memory)
short[] dm100 = plc.ReadDM(100, 5);              // DM100–DM104
plc.WriteDM(200, new short[] { 123, 456 });

// Đọc DINT (32-bit) và REAL (float)
int dint = plc.ReadDMInt(300);                    // DM300–DM301 as int
float real = plc.ReadDMFloat(700);                // DM700–DM701 as float

// Đọc/Ghi CIO bits
bool[] cio = plc.ReadCIO(0, 8);                   // CIO 0.0–0.7
plc.WriteCIO(10, new bool[] { true, false });

// Đọc WR, HR
short[] wr = plc.ReadWRWord(0, 10);               // WR0–WR9
short[] hr = plc.ReadHRWord(0, 5);                // HR0–HR4

// Timer / Counter
short[] timPv = plc.ReadTIM(0, 4);                 // Timer 0–3 present values
bool[] timFlag = plc.ReadTIMStatus(0, 4);          // Timer 0–3 completion flags

// Extended Memory (bank)
short[] em = plc.ReadEM(0, 100, 10);               // EM bank 0, address 100–109

// BCD
int bcd = plc.ReadBCD(500);                        // DM500 as BCD
plc.WriteBCD(500, 1234);

// String
string str = plc.ReadString(600, 10);              // DM600–DM609 as ASCII string
plc.WriteString(600, "Hello", 10);

// Generic API
var val = plc.Read("DM400");                       // Returns short
plc.Write("DM400", (short)999);

// Ngắt kết nối
plc.Disconnect();
plc.Dispose();

Vùng nhớ hỗ trợ

Vùng Loại FINS Code Phạm vi Mô tả
DM Word 0x82 0–32767 Data Memory
CIO Bit/Word 0x30/0xB0 0–6143 Core I/O
WR Bit/Word 0x31/0xB1 0–511 Work Area
HR Bit/Word 0x32/0xB2 0–511 Holding Area
AR Bit/Word 0x33/0xB3 0–959 Auxiliary (read-only)
EM Word 0xA0+ 0–32767/bank Extended Memory
TIM PV/Status 0x89/0x09 0–4095 Timer
CNT PV/Status 0x89/0x09 0–4095 Counter

PLC tương thích

  • Compact: CP1E, CP1H, CP1L, CP2E
  • Modular: CJ1M, CJ2M, CJ2H
  • Next-gen: NJ, NX series
  • Large-scale: CS1H, CS1G

Kiến trúc

OmronClient (IOmronClient)
    └── FinsTcpMaster (IFinsMaster)
          └── FinsEthernetAdapter (IFinsTransport)
                └── TCP Socket (port 9600)

Cấu trúc project

DBI.Drivers.Omron/
├── Comm/                  # Transport abstraction
│   ├── IFinsTransport.cs
│   ├── IFinsMaster.cs
│   └── FinsEthernetAdapter.cs
├── TCP/                   # FINS/TCP protocol
│   ├── FinsTcpMaster.cs
│   ├── FinsMessage.cs
│   └── FinsTcpHeader.cs
├── Interfaces/
│   └── IOmronClient.cs
├── DataTypes/
│   ├── OmronMemoryArea.cs
│   └── OmronTag.cs
├── Converters/
│   ├── WordConverter.cs
│   ├── DoubleWordConverter.cs
│   ├── FloatConverter.cs
│   ├── BcdConverter.cs
│   └── StringConverter.cs
├── Exceptions/
│   ├── FinsException.cs
│   ├── FinsNetworkException.cs
│   └── FinsEndCodeException.cs
├── OmronClient.cs
├── OmronConnectionType.cs
└── OmronAddressMap.cs

License

MIT

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.0.0 146 4/2/2026