PMcProtocol 2.1.7

dotnet add package PMcProtocol --version 2.1.7                
NuGet\Install-Package PMcProtocol -Version 2.1.7                
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="PMcProtocol" Version="2.1.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PMcProtocol --version 2.1.7                
#r "nuget: PMcProtocol, 2.1.7"                
#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.
// Install PMcProtocol as a Cake Addin
#addin nuget:?package=PMcProtocol&version=2.1.7

// Install PMcProtocol as a Cake Tool
#tool nuget:?package=PMcProtocol&version=2.1.7                

PMcProtocol

三菱plc通信MC协议的实现。此项目是McProtocol的分支。

This is a protocol for communicating with Mitsubishi PLCs.

拷贝的原项目 [Copy to]

https://github.com/SecondShiftEngineer/McProtocol

原项目文档 [Original document]

https://www.nuget.org/packages/McProtocol#readme-body-tab

下载包 [download、install]

Install-Package PMcProtocol

列子 [ensample code]

WindowsFormsApp1/Form1.cs

开始使用 [How To Use]

using McProtocol.Mitsubishi;

//端口一般为6000
McProtocolTcp mcProtocolTcp = new McProtocolTcp("127.0.0.1", 6000, McFrame.MC3E);
await mcProtocolTcp.Open();

//方式1(v>=2.0)
var oDataNew1 = await mcProtocolTcp.ReadDeviceBlock("D7500", 10);//以int16方式读取10个
var oDataNew2 = await mcProtocolTcp.GetBitDevice("M85", 10);//以位方式读取10个
await mcProtocolTcp.SetDevice("D7500", 1);//写
await mcProtocolTcp.SetBitDevice("M85", 1);//写

//方式2(历史遗留)
int[] oData1 = new int[10];//数据
await mcProtocolTcp.ReadDeviceBlock("D14520", 10, oData1);
int[] oData2 = new int[10];//数据
await mcProtocolTcp.GetBitDevice("M85", 10, oData2);

//方式3(历史遗留)
PLCData<bool> ints = new PLCData<bool>(PlcDeviceType.M, 85, 6);//使用位方式
await ints.ReadData();
var data = ints[0];//获取结果
ints[0] = !data;//修改数据
await ints.WriteData();//保存数据

PLCData<Int16> ints2 = new PLCData<Int16>(PlcDeviceType.D, 14520, 6);//使用16位整数方式
await ints2.ReadData();
var data2 = ints2[0];//获取结果
ints2[0] = 3;//修改数据
await ints2.WriteData();//写入数据

版本记录:[version history]

*表示部分代码可能与前版本不兼容 [*For some code is incompatible with previous versions]

v2.1.7

1.构造函数增加默认端口6000 [Default port]

v2.1.6

1.开放 PLCData[T].Bytes,可用于获取元数据 [Public PLCData[T].Bytes]

v2.1.5

1.对.Net5的支持 [Support for net5]

v2.1.0

1.增加读写锁,解决多线程网络拥堵的情况(在使用中请不要太频繁,可能会造成死锁) [add read/write lock,Solve network congestion under multi-threading]

v2.0.1

1.增加包注释 [add package comments]

v2.0.0 *

1.增加名称空间'McProtocol.Mitsubishi' [add using McProtocol.Mitsubishi]
2.扩展接口IPlc方法 [interface IPlc add function]
3.更新文档 [Update document]

v1.2.7

1.更新文档 [Update document]

v1.2.6

1.对net4.5的支持 [Support for net4.5]
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 was computed.  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. 
.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 net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  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.
  • .NETFramework 4.5

    • No dependencies.
  • .NETStandard 2.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
2.1.7 104 12/5/2024
2.1.6 1,078 8/3/2022
2.1.5 496 5/16/2022
2.1.0 454 5/10/2022
2.0.1 466 4/21/2022
2.0.0 445 4/19/2022
1.2.7 462 4/15/2022
1.2.6 458 4/15/2022