OmronFinsTCP.Net
OmronFinsTCP.Net copied to clipboard
欧姆龙plc通信FINS协议的实现。( This is a protocol for communicating with Omron PLCs.)
POmronFinsTCP.Net
欧姆龙plc通信FINS协议的实现。此项目是OmronFinsTCP.Net的分支。
This is a protocol for communicating with Omron PLCs.
拷贝的原项目:[Copy to:]
https://github.com/iHomeSoft/OmronFinsTCP.Net
下载包 [download、install]
Install-Package POmronFinsTCP.Net
列子:[ensample code:]
//普通方式列子
FinsDebuger/Form1.cs
//泛型方式列子
FinsDebuger/Form2.cs
开始使用 [How To Use]
连接 [connect]
using OmronFinsTCP.Net;
EtherNetPLC ENT = new EtherNetPLC();
short re = ENT.Link("192.168.1.100", 9600)
if (re == 0)
Console.WriteLine("ok");
else
Console.WriteLine("err");
普通方式:读/写 [read/write]
/*所有方法返回0为成功*/
ENT.ReadWord();//读单个Int16
ENT.ReadWords();//读多个Int16
ENT.WriteWord();//写单个Int16
ENT.WriteWords();//写多个Int16
ENT.GetBitState();//读单个位
ENT.SetBitState();//写单个位
ENT.ReadReal();//读单个浮点
ENT.WriteReal();//写单个浮点
ENT.ReadInt32();//读单个Int32
ENT.WriteInt32();//写单个Int32
泛型方式:读/写 [Use T:read/write]
/*T支持的类型为:int16,int32,bool,float*/
ENT.GetData<T>();//读一个数据
ENT.SetData<T>();//写一个数据
ENT.GetDatas<T>();//读多个数据
ENT.SetDatas<T>();//写多个数据(T支持的类型为:int16)