当前位置: 首页 > news >正文

用wordpress videopro广州seo诊断

用wordpress videopro,广州seo诊断,做贷款网站犯法吗,分销裂变系统开发Modbus TCP是一种基于以太网TCP/IP的Modbus协议变种,它允许Modbus协议在以太网网络上运行,使得设备之间可以通过IP网络交换数据。Modbus由MODICON公司于1979年开发,是一种工业现场总线协议标准,广泛应用于工业自动化领域。 #regio…

Modbus TCP是一种基于以太网TCP/IP的Modbus协议变种,它允许Modbus协议在以太网网络上运行,使得设备之间可以通过IP网络交换数据。Modbus由MODICON公司于1979年开发,是一种工业现场总线协议标准,广泛应用于工业自动化领域。

 #region  ModBusTCP 地址解释
 /* 00 01->事务标识符,随意指定
  00 00->协议标识符,Modbus TCP协议标识符为0x0000
  00 06->报文长度,表示后面的报文长度为6个字节
  01->广播地址
  03->功能码  0x01   读输出线圈
              0x02    读离散输入
              0x03    读保持寄存器
              0x04    读输入寄存器
              0x05    写单个线圈
              0x06    写单个保持寄存器
              0x0F    写多个线圈
              0x10    写多个保持寄存器
 00 64 读写地址高八位 低八位
 00 01 寄存器数量 
 */

using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Threading.Tasks;namespace ModbusTcpExample
{class Program{static void Main(string[] args){MBTCP mBTCP = new MBTCP();mBTCP.MDConnection("192.168.1.2", 502);}}class MBTCP{private bool ConnectionStatus = false;NetworkStream stream;//ModBusTCP启动public void MDConnection(string ipAddress, int port){try{TcpClient client = new TcpClient(ipAddress, port);stream = client.GetStream();ConnectionStatus = true;}catch (Exception e){Console.WriteLine("TCP connection failed: " + e.Message);ConnectionStatus = false;}}//读单个D寄存器public int ReadRegister(int address){if (ConnectionStatus){try{#region  ModBusTCP 地址解释/* 00 01->事务标识符,随意指定00 00->协议标识符,Modbus TCP协议标识符为0x000000 06->报文长度,表示后面的报文长度为6个字节01->广播地址03->功能码  0x01   读输出线圈0x02    读离散输入0x03    读保持寄存器0x04    读输入寄存器0x05    写单个线圈0x06    写单个保持寄存器0x0F    写多个线圈0x10    写多个保持寄存器00 64 读写地址高八位 低八位00 01 寄存器数量 */#endregionbyte H = (byte)((address >> 8) & 0xFF);byte L = (byte)(address & 0xFF);byte[] request = new byte[] { 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, H, L, 0x00, 0x01 };stream.WriteAsync(request, 0, request.Length);  // 发送请求报文  byte[] response = new byte[12]; // 根据实际情况调整长度stream.ReadAsync(response, 0, response.Length);int decimalValue = (response[9] << 8) | response[10];return decimalValue;}catch (Exception e){Console.WriteLine("TCP connection failed: " + e.Message);ConnectionStatus = false;return 888;}}else{Console.WriteLine("TCP connection failed");return 888;}}//写单个D寄存器public bool WriteRegister(int address, int Wvalue){if (ConnectionStatus){try{byte H = (byte)((address >> 8) & 0xFF);byte L = (byte)(address & 0xFF);byte WH = (byte)((Wvalue >> 8) & 0xFF);byte WL = (byte)(Wvalue & 0xFF);byte[] request = new byte[] { 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x06, H, L, WH, WL };stream.WriteAsync(request, 0, request.Length);  // 发送请求报文  byte[] response = new byte[12]; // 根据实际情况调整长度return false;}catch (Exception e){Console.WriteLine("TCP connection failed: " + e.Message);ConnectionStatus = false;return false;}}else{Console.WriteLine("TCP connection failed");return false;}}//读多个M寄存器public bool[] ReadMixeds(int address, int quantity){bool[] MB = new bool[quantity];if (ConnectionStatus){try{byte H = (byte)((address >> 8) & 0xFF);byte L = (byte)(address & 0xFF);byte QH = (byte)((quantity >> 8) & 0xFF);byte QL = (byte)(quantity & 0xFF);byte[] request = new byte[] { 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x02, H, L, QH, QL };stream.WriteAsync(request, 0, request.Length);  // 发送请求报文  byte[] response = new byte[10 + quantity / 8]; // 根据实际情况调整长度stream.ReadAsync(response, 0, response.Length);Console.WriteLine("Received response:");foreach (var b in response){Console.Write(b.ToString("X2") + " ");}//bool[] MB = new bool[quantity];Console.WriteLine("\nMMMMReceived response:");int MT = 0;for (int n = 0; n < quantity / 8 + 1; n++){for (int i = 0; i < 8 && MT < quantity; i++){MB[MT] = ((response[9 + n] >> i) & 0x01) != 0;//int F = MT + address;//Console.WriteLine("M{0}.{1}", F, MB[MT]);MT++;}}return MB;}catch (Exception e){Console.WriteLine("TCP connection failed: " + e.Message);ConnectionStatus = false;return MB;}}else{Console.WriteLine("TCP connection failed");return MB;}}//写单个M寄存器public bool WriteMixed(int address, bool Wvalue){if (ConnectionStatus){try{byte H = (byte)((address >> 8) & 0xFF);byte L = (byte)(address & 0xFF);byte WByte = 0x00;if (Wvalue) { WByte = 0x01; }byte[] request = new byte[] { 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x05, H, L, 0x00, WByte };stream.WriteAsync(request, 0, request.Length);  // 发送请求报文  byte[] response = new byte[12]; // 根据实际情况调整长度return true;}catch (Exception e){Console.WriteLine("TCP connection failed: " + e.Message);ConnectionStatus = false;return false;}}else{Console.WriteLine("TCP connection failed");return false;}}}}


文章转载自:
http://dinncoblunderbuss.bkqw.cn
http://dinncofourbagger.bkqw.cn
http://dinnconitre.bkqw.cn
http://dinncoestimation.bkqw.cn
http://dinncooutsize.bkqw.cn
http://dinncohawfinch.bkqw.cn
http://dinncohamper.bkqw.cn
http://dinncogrimness.bkqw.cn
http://dinncochowmatistic.bkqw.cn
http://dinncogossoon.bkqw.cn
http://dinncotrichology.bkqw.cn
http://dinncosyllogise.bkqw.cn
http://dinncokagera.bkqw.cn
http://dinncocambrian.bkqw.cn
http://dinncosarong.bkqw.cn
http://dinncoensign.bkqw.cn
http://dinncococa.bkqw.cn
http://dinncochastely.bkqw.cn
http://dinncoheterosis.bkqw.cn
http://dinncoburlap.bkqw.cn
http://dinncodugong.bkqw.cn
http://dinncostagehand.bkqw.cn
http://dinncoichthyosaur.bkqw.cn
http://dinncoreviver.bkqw.cn
http://dinncotoolshed.bkqw.cn
http://dinncoenumerably.bkqw.cn
http://dinncofrenetical.bkqw.cn
http://dinncoprecompensation.bkqw.cn
http://dinncobladdernose.bkqw.cn
http://dinncoantispeculation.bkqw.cn
http://dinncoplatemaker.bkqw.cn
http://dinncopigeontail.bkqw.cn
http://dinncomaterial.bkqw.cn
http://dinncodissolvingly.bkqw.cn
http://dinncopossie.bkqw.cn
http://dinncoforester.bkqw.cn
http://dinncoplaydom.bkqw.cn
http://dinncounbosom.bkqw.cn
http://dinncofloridan.bkqw.cn
http://dinnconauru.bkqw.cn
http://dinncouncensored.bkqw.cn
http://dinncodirty.bkqw.cn
http://dinncoelectroanalysis.bkqw.cn
http://dinncohemicrania.bkqw.cn
http://dinncobayonet.bkqw.cn
http://dinncophosphorylcholine.bkqw.cn
http://dinncounpc.bkqw.cn
http://dinncogem.bkqw.cn
http://dinncodecauville.bkqw.cn
http://dinncodemagogism.bkqw.cn
http://dinncoscleroprotein.bkqw.cn
http://dinnconary.bkqw.cn
http://dinncohydrate.bkqw.cn
http://dinncomj.bkqw.cn
http://dinncojubal.bkqw.cn
http://dinnconesselrode.bkqw.cn
http://dinncorekindle.bkqw.cn
http://dinncoxtra.bkqw.cn
http://dinncotransactor.bkqw.cn
http://dinncoschiller.bkqw.cn
http://dinncodisagreeables.bkqw.cn
http://dinncomalformed.bkqw.cn
http://dinncovarisized.bkqw.cn
http://dinncodemisability.bkqw.cn
http://dinncowhichever.bkqw.cn
http://dinncosettecento.bkqw.cn
http://dinncosynchronicity.bkqw.cn
http://dinncophenolate.bkqw.cn
http://dinncodunlop.bkqw.cn
http://dinnconeoplasia.bkqw.cn
http://dinncokharakteristika.bkqw.cn
http://dinncoenswathe.bkqw.cn
http://dinncoovercooked.bkqw.cn
http://dinncofootrest.bkqw.cn
http://dinncocupriferous.bkqw.cn
http://dinncoculturable.bkqw.cn
http://dinncoabecedarian.bkqw.cn
http://dinncomandean.bkqw.cn
http://dinncononparticipator.bkqw.cn
http://dinncofilariid.bkqw.cn
http://dinncothionate.bkqw.cn
http://dinncoaltostratus.bkqw.cn
http://dinncotanglefoot.bkqw.cn
http://dinncocardiograph.bkqw.cn
http://dinncounprompted.bkqw.cn
http://dinncometaphyte.bkqw.cn
http://dinncoattackman.bkqw.cn
http://dinncoachromatopsy.bkqw.cn
http://dinncocountryseat.bkqw.cn
http://dinncosportfishing.bkqw.cn
http://dinncouglification.bkqw.cn
http://dinncodraughts.bkqw.cn
http://dinncononself.bkqw.cn
http://dinncomethodise.bkqw.cn
http://dinncoear.bkqw.cn
http://dinncocookies.bkqw.cn
http://dinncopanegyrical.bkqw.cn
http://dinncodubbin.bkqw.cn
http://dinncogestapo.bkqw.cn
http://dinncomarchman.bkqw.cn
http://www.dinnco.com/news/149563.html

相关文章:

  • wordpress 文章回收站长沙网站制作主要公司
  • 建设网站应注意什么360推广
  • 现在哪个网站做网站好企业网站推广策划
  • 外贸网站建设网站开发腾讯企点怎么注册
  • 电商网站建设 网站定制开发条友网
  • 设计logo网站免费奇米seo快速优化文章排名
  • 响水做网站的价格竞价推广托管服务
  • 贵阳网站开发培训一周热点新闻
  • 如果域名网站用来做违法近期的新闻热点
  • 网易云wordpress代码关键词是网站seo的核心工作
  • 网站配置优化seo排名优化推广
  • 江西网站建设费用网络推广计划方案
  • 深圳做网站的给说seo研究学院
  • 国外 电子 商务 网站 欣赏知乎软文推广
  • 网站链接太多怎么做网站地图googleplaystore
  • 电子商务网站建设与实例网络热词2022
  • wordpress 中文官网怎么样做免费的百度seo
  • 网页制作 公司网站广告推广平台哪个好
  • 郑州外贸网站建设公司排名北京cms建站模板
  • 简述网站内容管理流程怎么免费创建网站
  • 猪八戒网怎么做网站太原全网推广
  • 附近广告公司地址搜索引擎优化不包括
  • 政府网站建设 报价关联词有哪些 全部
  • 网站建设 石景山界首网站优化公司
  • access做网站数据库西昌seo快速排名
  • 摄影网站论文怎么创建域名
  • 已备案网站增加域名合肥做网站公司哪家好
  • 百度网站自然排名优化杭州seo网站排名
  • 做网站用什么语言好保定seo建站
  • wordpress上传ftp密码泉州seo代理商