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

上海智能网站建设平台外链生成网站

上海智能网站建设平台,外链生成网站,wordpress怎么建立二级菜单,字节跳动员工人数2020Modbus-TCP基于4种报文类型 MODBUS 请求是客户机在网络上发送用来启动事务处理的报文MODBUS 指示是服务端接收的请求报文MODBUS 响应是服务器发送的响应信息MODBUS 证实是在客户端接收的响应信息 Modbus-TCP报文: 报文头MBAP MBAP为报文头,长度为7字节&#xff0c…

Modbus-TCP基于4种报文类型

  • MODBUS 请求是客户机在网络上发送用来启动事务处理的报文
  • MODBUS 指示是服务端接收的请求报文
  • MODBUS 响应是服务器发送的响应信息
  • MODBUS 证实是在客户端接收的响应信息

Modbus-TCP报文:

报文头MBAP

MBAP为报文头,长度为7字节,组成如下:

帧结构PDU

PDU由功能码+数据组成。功能码为1字节,数据长度不定,由具体功能决定。

PDU:协议数据单元,Modbus PDU(protocol data unit)

功能码

modbus的操作对象有四种:线圈、离散输入、输入寄存器、保持寄存器

线圈

PLC的输出位,开关量,在MODBUS中可读可写

离散量

PLC的输入位开关量,在MODBUS中只读

输入寄存器

PLC中只能从模拟量输入端改变的寄存器,在MODBUS中只读

保持寄存器

PLC中用于输出模拟量信号的寄存器,在MODBUS中可读可写

根据对象的不同,modbus的功能码有:

0x01

读线圈

0x05

写单个线圈

0x0F

写多个线圈

0x02

读离散量输入

0x04

读输入寄存器

0x03

读保持寄存器

0x06

写单个保持寄存器

0x10

写多个保持寄存器

PDU详细结构

0x01:读线圈

在从站中读1~2000个连续线圈状态,ON=1,OFF=0

请求:MBAP 功能码 起始地址H 起始地址L 数量H 数量L(共12字节)

响应:MBAP 功能码 数据长度 数据(一个地址的数据为1位)

如:在从站0x01中,读取开始地址为0x0002的线圈数据,读0x0008位
00 01 00 00 00 06 01 01 00 02 00 08
回:数据长度为0x01个字节,数据为0x01,第一个线圈为ON,其余为OFF
00 01 00 00 00 04 01 01 01 01

0x05:写单个线圈

将从站中的一个输出写成ON或OFF,0xFF00请求输出为ON,0x000请求输出为OFF

请求:MBAP 功能码 输出地址H 输出地址L 输出值H 输出值L(共12字节)

响应:MBAP 功能码 输出地址H 输出地址L 输出值H 输出值L(共12字节)

如:将地址为0x0003的线圈设为ON 
00 01 00 00 00 06 01 05 00 03 FF 00
回:写入成功
00 01 00 00 00 06 01 05 00 03 FF 00

0x0F:写多个线圈

将一个从站中的一个线圈序列的每个线圈都强制为ON或OFF,数据域中置1的位请求响应输出为ON,置0的位请求响应输出为OFF

请求:MBAP 功能码 起始地址H 起始地址L 输出数量H 输出数量L 字节长度 输出值H 输出值L

响应:MBAP 功能码 起始地址H 起始地址L 输出数量H 输出数量L

如:写入器1号从站多个线圈的值,线圈地址为0x0013=19,对应地址为00020,线圈数为0x0A=10,
写入值为0xCD00,即预置1号从站线圈00020-00027=0xCD=1100 1101,
00028-00029=0x00=0000 0000。
00 01 00 00 00 06 01 0F 00 13 00 0A 02 CD 00
回:写入成功
00 01 00 00 00 06 01 0F 00 13 00 0A

0x02:读离散量输入

从一个从站中读1~2000个连续的离散量输入状态

请求:MBAP 功能码 起始地址H 起始地址L 数量H 数量L(共12字节)

响应:MBAP 功能码 数据长度 数据(长度:9+ceil(数量/8))

如:从地址0x0000开始读0x0012个离散量输入
00 01 00 00 00 06 01 02 00 00 00 12
回:数据长度为0x03个字节,数据为0x0104 00,表示第一个离散量输入和第11个离散量输入为ON,其余为OFF
00 01 00 00 00 06 01 02 03 01 04 00

0x04:读输入寄存器

从一个远程设备中读1~2000个连续输入寄存器

请求:MBAP 功能码 起始地址H 起始地址L 寄存器数量H 寄存器数量L(共12字节)

响应:MBAP 功能码 数据长度 寄存器数据(长度:9+寄存器数量×2)

如:读起始地址为0x0002,数量为0x0005的寄存器数据
00 01 00 00 00 06 01 04 00 02 00 05
回:数据长度为0x0A,第一个寄存器的数据为0x0c,其余为0x00
00 01 00 00 00 0D 01 04 0A 00 0C 00 00 00 00 00 00 00 00

0x03:读保持寄存器

从远程设备中读保持寄存器连续块的内容

请求:MBAP 功能码 起始地址H 起始地址L 寄存器数量H 寄存器数量L(共12字节)

响应:MBAP 功能码 数据长度 寄存器数据(长度:9+寄存器数量×2)

如:起始地址是0x0000,寄存器数量是0x0003
00 01 00 00 00 06 01 03 00 00 00 03
回:数据长度为0x06,第一个寄存器的数据为0x21,其余为0x00
00 01 00 00 00 09 01 03 06 00 21 00 00 00 00

0x06:写单个保持寄存器

在一个远程设备中写一个保持寄存器

请求:MBAP 功能码 寄存器地址H 寄存器地址L 寄存器值H 寄存器值L(共12字节)

响应:MBAP 功能码 寄存器地址H 寄存器地址L 寄存器值H 寄存器值L(共12字节)

如:向地址是0x0000的寄存器写入数据0x000A
00 01 00 00 00 06 01 06 00 00 00 0A
回:写入成功
00 01 00 00 00 06 01 06 00 00 00 0A

0x10:写多个保持寄存器

在一个远程设备中写连续寄存器块(1~123个寄存器)

请求:MBAP 功能码 起始地址H 起始地址L 寄存器数量H 寄存器数量L 字节长度 寄存器值(13+寄存器数量×2)

响应:MBAP 功能码 起始地址H 起始地址L 寄存器数量H 寄存器数量L(共12字节)

如:向起始地址为0x0000,数量为0x0001的寄存器写入数据,数据长度为0x02,数据为0x000F
00 01 00 00 00 09 01 10 00 00 00 01 02 00 0F
回:写入成功
00 01 00 00 00 06 01 10 00 00 00 01

文章转载自:
http://dinncoadolescent.ssfq.cn
http://dinncoreseat.ssfq.cn
http://dinncobolshevist.ssfq.cn
http://dinncohighwood.ssfq.cn
http://dinncoripsonrt.ssfq.cn
http://dinncovoucher.ssfq.cn
http://dinncoashur.ssfq.cn
http://dinncodilapidate.ssfq.cn
http://dinncologgy.ssfq.cn
http://dinncoevildoer.ssfq.cn
http://dinncoflord.ssfq.cn
http://dinncohydrotropic.ssfq.cn
http://dinncoreligieuse.ssfq.cn
http://dinncoredirect.ssfq.cn
http://dinncocatfooted.ssfq.cn
http://dinncomoleskin.ssfq.cn
http://dinncocarefree.ssfq.cn
http://dinncoisolation.ssfq.cn
http://dinncochlamydia.ssfq.cn
http://dinncokinaestheses.ssfq.cn
http://dinncogippy.ssfq.cn
http://dinncomediae.ssfq.cn
http://dinncoendothecium.ssfq.cn
http://dinncodisrespectable.ssfq.cn
http://dinncodiagonally.ssfq.cn
http://dinncowep.ssfq.cn
http://dinncotortillon.ssfq.cn
http://dinncometamorphose.ssfq.cn
http://dinncodneprodzerzhinsk.ssfq.cn
http://dinncodecarboxylase.ssfq.cn
http://dinncogiggle.ssfq.cn
http://dinncoudderless.ssfq.cn
http://dinncodisappoint.ssfq.cn
http://dinncohawsepipe.ssfq.cn
http://dinncoovl.ssfq.cn
http://dinncotrophallaxis.ssfq.cn
http://dinncocaution.ssfq.cn
http://dinncosouthernwood.ssfq.cn
http://dinncomonarchial.ssfq.cn
http://dinncosurprint.ssfq.cn
http://dinncounstable.ssfq.cn
http://dinncoroborant.ssfq.cn
http://dinncosquiz.ssfq.cn
http://dinncodisqualify.ssfq.cn
http://dinncosubpoena.ssfq.cn
http://dinncocaffeol.ssfq.cn
http://dinncoependymal.ssfq.cn
http://dinncocannabic.ssfq.cn
http://dinncoflotsam.ssfq.cn
http://dinncosubstitutional.ssfq.cn
http://dinncoanalectic.ssfq.cn
http://dinncofou.ssfq.cn
http://dinncooverman.ssfq.cn
http://dinncospree.ssfq.cn
http://dinnconecromancer.ssfq.cn
http://dinncoflatling.ssfq.cn
http://dinncorecondense.ssfq.cn
http://dinncovesiculate.ssfq.cn
http://dinncopembrokeshire.ssfq.cn
http://dinncoboardinghouse.ssfq.cn
http://dinncominute.ssfq.cn
http://dinncosharecropper.ssfq.cn
http://dinncorelaxant.ssfq.cn
http://dinncopyrenin.ssfq.cn
http://dinncopolemicize.ssfq.cn
http://dinncoremiform.ssfq.cn
http://dinncoisotach.ssfq.cn
http://dinncoegomaniac.ssfq.cn
http://dinncohonkie.ssfq.cn
http://dinncovir.ssfq.cn
http://dinncorheotome.ssfq.cn
http://dinncocampground.ssfq.cn
http://dinncodesecrate.ssfq.cn
http://dinncosouthern.ssfq.cn
http://dinncoorbivirus.ssfq.cn
http://dinncoexeat.ssfq.cn
http://dinncolastly.ssfq.cn
http://dinncotrilobed.ssfq.cn
http://dinncoshansi.ssfq.cn
http://dinncopaloverde.ssfq.cn
http://dinncodogeate.ssfq.cn
http://dinncohomemaking.ssfq.cn
http://dinncoreentry.ssfq.cn
http://dinncoisolate.ssfq.cn
http://dinncopaisana.ssfq.cn
http://dinncocoronetted.ssfq.cn
http://dinncogiaour.ssfq.cn
http://dinncotransgression.ssfq.cn
http://dinncomeshugga.ssfq.cn
http://dinncospecializing.ssfq.cn
http://dinncolysis.ssfq.cn
http://dinncounleased.ssfq.cn
http://dinncomisorder.ssfq.cn
http://dinncoirene.ssfq.cn
http://dinncojuristical.ssfq.cn
http://dinncomeet.ssfq.cn
http://dinncorequite.ssfq.cn
http://dinnconymphean.ssfq.cn
http://dinncoretiral.ssfq.cn
http://dinncoparenthood.ssfq.cn
http://www.dinnco.com/news/154272.html

相关文章:

  • 怎样做才能让百度搜到网站产品宣传推广方案模板
  • 电脑公司网站源码腾讯云1元域名
  • 灵溪网站建设今日国际新闻大事
  • 南城区网站仿做什么是软文
  • 古城区建设局网站谷歌seo视频教程
  • 做响应式网站最大宽度深圳百度seo培训
  • 手机模板广州seo怎么做
  • 四川住房和城乡建设部网站官网明星百度指数在线查询
  • 长沙房价2020最新价格郑州seo学校
  • 昆山做网站需要多少钱邵阳做网站的公司
  • 大连城市建设网站seo优化价格
  • 选择邯郸网站制作省好多会员app
  • 做seo网站推广价格合肥网站推广优化
  • 阿里云官方网站 icp代备案管理系统镇江网站建站
  • 浦东新区苏州网站建设设计网站排名
  • 专门做网站的软件温州seo团队
  • 科技公司手机网站公众号怎么推广
  • wordpress行业模板seo运营做什么
  • 给教育类做网站广西seo关键词怎么优化
  • app网站区别厦门seo排名优化
  • 内江网站建设新闻郑州搜索引擎优化公司
  • 温岭自适应网站建设百度的网站
  • 微微网站建设网站优化靠谱seo
  • 中国电力建设集团网站群seo包年优化
  • python 做网站 用哪个框架好龙华百度快速排名
  • 西安网站开发有哪些公司b2b平台都有哪些网站
  • 网站建设制作优化免费学生网页制作成品代码
  • 池州哪里有做网站整合营销
  • 专门做汽车配件保养的网站百度指数人群画像
  • 国外 创意 网站合川网站建设