PLC_Communication 12.3.3.1
dotnet add package PLC_Communication --version 12.3.3.1
NuGet\Install-Package PLC_Communication -Version 12.3.3.1
<PackageReference Include="PLC_Communication" Version="12.3.3.1" />
<PackageVersion Include="PLC_Communication" Version="12.3.3.1" />
<PackageReference Include="PLC_Communication" />
paket add PLC_Communication --version 12.3.3.1
#r "nuget: PLC_Communication, 12.3.3.1"
#:package PLC_Communication@12.3.3.1
#addin nuget:?package=PLC_Communication&version=12.3.3.1
#tool nuget:?package=PLC_Communication&version=12.3.3.1
PLCCommunication
PLCCommunication 依赖说明
NetFramework 依赖项: Newtonsoft.Json.dll
NET8.0 依赖项: Newtonsoft.Json.dll System.IO.Ports.dll
What is PLCCommunication
This is an industrial IoT based, computer communications architecture implementation, integrated with most of the basic functional implementation of industrial software development, such as Mitsubishi PLC Communications, Siemens PLC Communications, OMRON PLC Communications, Modbus Communications, All of these communications have been implemented in multiple languages, and of course, the feature integration of the main. NET Library is even more powerful, in addition to the implementation of cross-program, cross-language, cross-platform communication, so that you are no longer obsessed with the use of Windows or Linux system, the realization of log function, flow number generation function, mail sending function, Fourier transform function, and so on, will integrate more common features of industrial environment in the future.
In order not to let the industry 4.0 stay on the slogan, the high-rise flat up, and the cornerstone is PLCCommunication.
What can PLCCommunication do
PLCCommunication can connect the equipment of the industrial production site to the free transmission of data at the bottom, whether active or passive, whatever your acquisition system (usually the acquisition system is a Windows computer, or an embedded system, or a Linux-based box), can achieve the random transmission of data, convenient and fast to achieve a strong, real-time, high-response robust system, whether you are building a C/S system, or B/S system, or C-B-S-A (Integrated desktop client, browser, Android) hybrid system, is a fast and low-cost implementation,
As long as you have the primary data of the industrial field, that is, can build a powerful real-time monitoring function of the software, production reports and automated scheduling software, a variety of process parameters history tracking software, data based on the experience of machine learning software, as well as full-featured MES system and so on.
By the way, the traditional industrial model is the procurement of off-the-shelf industrial software, including the host computer software and MES system, while ignoring their own system. For some industry-standard functional software, such as ERP systems, financial software, these can be purchased directly, However, for the host computer and MES system, the actual needs of each enterprise are very different, it is difficult to have a common scene, and the current situation is to spend a lot of money to do small things, so here, give a future-oriented model to achieve: for the production enterprise, Based on PLCCommunication to develop enterprise-class MES system implementation, as the core Warehouse center of data, and business logic processing Center, for equipment suppliers, based on PLCCommunication to develop the host computer software system, fast and convenient distribution of data to the customer's MES system, work together.
PLCCommunication.dll Summary
When I started working on this project, I had an idea of how to easily and quickly read and write PLC data. Our code logic should be very simple, and it only takes one or two lines of code to implement this feature. Like this
// Pseudo code
PLC plc = new PLC("192.168.0.11", 6000);
short value = plc.ReadInt16("D100");
But after a long period of development and attempt, found that the return of PLC is likely to be abnormal, this anomaly may come from the network failure, may also come from you entered the wrong address, or the PLC itself is not allowed to operate, so in this project added a class Operateresult, So the final code becomes what it looks like (with Siemens PLC as an example)
SiemensS7Net siemens = new SiemensS7Net( SiemensPLCS.S1200, " 192.168.1.110" );
OperateResult<short> read = siemens.ReadInt16("M100");
if(read.IsSuccess)
{
// you get the right value
short value = read.Content;
}
else
{
// failed , but you still can know the failed detail
Consolo.WriteLine(read.Message);
}
Of course, you can also write very concise, because the judgment of success is ignored, so the following operation is risky.
SiemensS7Net siemens = new SiemensS7Net( SiemensPLCS.S1200, " 192.168.1.110" );
short value = siemens.ReadInt16("M100").Content; // Look at this code, isn't it very succinct.
When use .Net4.5 or higher plateform. we can use like this
SiemensS7Net siemens = new SiemensS7Net( SiemensPLCS.S1200, " 192.168.1.110" );
short value = (await siemens.ReadInt16Async("M100")).Content; // Look at this code, isn't it very succinct.
The above operation we have read the data, but is based on a short connection, when the reading of the data finished, automatically shut down the network, if you want to open a long connection, follow the following actions.
SiemensS7Net siemens = new SiemensS7Net( SiemensPLCS.S1200, " 192.168.1.110" );
siemens.SetPersistentConnection( );
OperateResult<short> read = siemens.ReadInt16("M100");
if(read.IsSuccess)
{
// you get the right value
short value = read.Content;
}
else
{
// failed , but you still can know the failed detail
Consolo.WriteLine(read.Message);
}
// when you don't want read data, you should call close method
siemens.ConnectClose( );
When use .Net4.5 or higher plateform. we can use like this
SiemensS7Net siemens = new SiemensS7Net( SiemensPLCS.S1200, " 192.168.1.110" );
siemens.SetPersistentConnection( );
OperateResult<short> read = await siemens.ReadInt16Async("M100");
if(read.IsSuccess)
{
// you get the right value
short value = read.Content;
}
else
{
// failed , but you still can know the failed detail
Consolo.WriteLine(read.Message);
}
// when you don't want read data, you should call close method
siemens.ConnectClose( );
So we can see that all the other modes of communication are similar to this, including Mitsubishi PLC, Siemens PLC,AB PLC, OMRON PLC, Keane plc, Panasonic Plc, redis Communications, EFT Robots, Kuka robots and so on, including its own support for the PLCCommunication protocol.
The goal is to reduce the cost of learning for developers, and usually you have to learn how to use several different libraries and learn the basics of PLC. Now, all you need to know is how the basic PLC address is represented, and you can read and write PLC data.
Another feature of this project is support for cross-language communication support. You can build a C # background server that supports Windows desktop application and Web background, and Android phone-side, Python programs, Java programs to communicate. server side code:
class Program
{
static void Main(string[] args)
{
NetSimplifyServer simplifyServer;
try
{
simplifyServer = new NetSimplifyServer( );
simplifyServer.ReceiveStringEvent += SimplifyServer_ReceiveStringEvent;
simplifyServer.ServerStart( 12345 );
}
catch(Exception ex )
{
Console.WriteLine( "Create failed: " + ex.Message );
Return;
}
Console.ReadLine();
}
private static void SimplifyServer_ReceiveStringEvent( AppSession session, NetHandle handle, string value )
{
if (handle == 1)
{
// Message to operate when a signal from the client is received 1
simplifyServer.SendMessage( session, handle, "This is test single:" + value );
}
else
{
simplifyServer.SendMessage( session, handle, "not supported msg" );
}
// Show out, who sent it, what did it send?
Console.WriteLine($"{session} [{handle}] {value}");
}
}
C# Client Side (Also asp.net mvc, asp.net core mvc)
NetSimplifyClient simplifyClient = new NetSimplifyClient( "127.0.0.1", 12345 );
string value = simplifyClient.ReadFromServer( 1, "test" ).Content;
Note: In the source code, still contains a lot of Chinese annotation, in the future for a short period of time, will be used in English and Chinese double annotation, thank you for your understanding.
Thank you for your understanding
Product | Versions 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. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.1
- 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 |
---|---|---|
12.3.3.1 | 186 | 8/9/2025 |