ZhangGuoWei 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package ZhangGuoWei --version 1.0.0
                    
NuGet\Install-Package ZhangGuoWei -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="ZhangGuoWei" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZhangGuoWei" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ZhangGuoWei" />
                    
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 ZhangGuoWei --version 1.0.0
                    
#r "nuget: ZhangGuoWei, 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 ZhangGuoWei@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=ZhangGuoWei&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ZhangGuoWei&version=1.0.0
                    
Install as a Cake Tool

ZhangGuoWei

Modbus TCP / 串口通信库,封装立体仓库巷道堆垛机(CTU)PLC 协议。跨平台(Windows / Linux),兼容汇川、西门子 PLC。

功能

  • Modbus TCP 客户端(ModbusClient):Socket 长连接、超时控制、断线事件通知
  • 巷道设备协议(StockDevice):
    • 任务下发(D100-D209,双取双放/背篓/大小箱混放全字段)
    • 任务完成信号读取/清除(D260-D264)
    • 监控数据(D310-D359)、报警数据(D300-D349)、统计数据读取(D360-D409)
    • PLC 版本号读取(D0-D5)
  • 串口通信:Modbus RTU 串口收发

安装

dotnet add package ZhangGuoWei

快速上手

using System.Net;
using ModbusLib;
using ModbusLib.ConnectDevice;
using ModbusLib.Models;

// 1. 连接PLC(堆垛机)
var endpoint = new IPEndPoint(IPAddress.Parse("192.168.1.10"), 502);
var device = new StockDevice(new ModbusClient(endpoint), 0);

// 2. 校验PLC版本
PlcVersion? version = device.DoGetPlcVersion();

// 3. 下发任务(PlcType: 1-汇川 2-西门子)
var task = new PlcTask
{
    PLCNumber = 1,
    PLCTaskNo = 1001,
    TaskType = 11,          // 11-入库取 12-入库放 21-出库取 22-出库放 31/32-移库 1-标定 2-盘点
    XCH = 1,                // 1-单取单放A 2-单取单放B ... 41-双取双放
    S_XST_X1 = 1250.5,      // 主轴起点坐标
    E_XST_X1 = 3300.0,      // 主轴终点坐标
    XCH_XA1 = -85.0,        // 货叉A起点
    XCH_XA2 = 85.0,         // 货叉A终点
};
bool ok = device.DoWriteTask(task, 1);

// 4. 轮询任务完成信号
PLCTaskComplete? complete = device.DoReadD260_D264();
device.DoClearD260_D264(); // 清除完成信号

// 5. 读取监控/报警/统计数据
PLCMonitor? monitor = device.DoReadD310_D359();
PLCCallPolice? alarm = device.DoReadD300_D349();

目标框架

  • .NET 6.0 (LTS)
  • .NET 8.0 (LTS)
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 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.

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