Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - modbus
Search - modbus - List
using HslCommunication.ModBus; using HslCommunication; // 读取操作 bool coil100 = busTcpClient.ReadCoil("100").Content; // 读取线圈100的通断 short short100 = busTcpClient.ReadInt16("100").Content; // 读取寄存器100的short值 ushort ushort100 = busTcpClient.ReadUInt16("100").Content; // 读取寄存器100的ushort值 int int100 = busTcpClient.ReadInt32("100").Content; // 读取寄存器100-101的int值 uint uint100 = busTcpClient.ReadUInt32("100").Content; // 读取寄存器100-101的uint值 float float100 = busTcpClient.ReadFloat("100").Content; // 读取寄存器100-101的float值 long long100 = busTcpClient.ReadInt64("100").Content; // 读取寄存器100-103的long值 ulong ulong100 = busTcpClient.ReadUInt64("100").Content; // 读取寄存器100-103的ulong值 double double100 = busTcpClient.ReadDouble("100").Content; // 读取寄存器100-103的double值 string str100 = busTcpClient.ReadString("100", 5).Content;// 读取100到104共10个字符的字符串 // 写入操作 busTcpClient.WriteCoil("100", true);// 写入线圈100为通 busTcpClient.Write("100", (short)12345);// 写入寄存器100为12345 busTcpClient.Write("100", (ushort)45678);// 写入寄存器100为45678 busTcpClient.Write("100", 123456789);// 写入寄存器100-101为123456789 busTcpClient.Write("100", (uint)123456778);// 写入寄存器100-101为123456778 busTcpClient.Write("100", 123.456);// 写入寄存器100-101为123.456 busTcpClient.Write("100", 12312312312414L);//写入寄存器100-103为一个大数据 busTcpClient.Write("100", 12634534534543656UL);// 写入寄存器100-103为一个大数据 busTcpClient.Write("100", 123.456d);// 写入寄存器100-103为一个双精度的数据 busTcpClient.Write("100", "K123456789");
Date : 2020-01-14 Size : 344.91kb User : cff621628@126.com

什么是HSL? 这是一个基于工业物联网,计算机通讯的架构实现,集成了工业软件开发的大部分的基础功能实现,比如三菱PLC通讯,西门子PLC通讯,欧姆龙PLC通讯,modbus通讯,AB PLC,基恩士PLC,台达PLC,松下PLC,GE PLC通讯等等,这些通讯全部进行了多语言的实现,当然,主打的 .net 库的功能集成还更加的强大,除此之外,还实现了跨程序,跨语言,跨平台的通讯,让你不再纠结于使用windows还是 linux系统,实现了日志功能,流水号生成功能,邮件发送功能,傅立叶变换功能,等等,将来会集成更多的工业环境常见功能的实现。 为了不让工业4.0只停留在口号上,万丈高楼平地起,而基石就是HSL。
Date : 2021-10-13 Size : 1mb User : laytau
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.