zoukankan      html  css  js  c++  java
  • modbus 指令16 $10 的格式

     {
       //写多个请求 01(从设备)10(功能码) 00 77(起始地址) 00 01(寄存器数) 02(字节数) 05 55(写的数据) 6F B8(CRC)
      //写多个返回 01(从设备) 10(功能码) 00 77(起始地址)  00 01(寄存器数) b1 d3 CRC)
      //读多个请求  01(从设备) 03(功能码) 00 77(起始地址) 00 01(寄存器数) 34 10(CRC)
      //读多个返回 01(从设备) 03(功能码) 02(数据域字节数) 05 55(具体数据) 7b 2b(CRC)
       }
    
     {var
            buf : array[0..3] of byte;
            Pint:PInteger;
          begin
            buf[0] := $00;   //最低位
            buf[1] := $01;
            buf[2] := $02;
            buf[3] := $03;  //最高位
            Pint:=@buf[0];
            ShowMessage(IntToStr( Pint^));
          end;}
          {var
            buf : array[0..1] of byte;
            Pint:PSmallInt;
          begin
            buf[0] := $FF;   //最低位
            buf[1] := $FF;   //最高位
            pint:= @buf[0];
            ShowMessage(IntToStr( Pint^));
          end;
          }
    书搞进脑袋 创新 创造; 积极
  • 相关阅读:
    SpringBoot学习历程
    日期和时间库Joda Time
    apache commons validator
    apache commons fileupload
    apache commons io
    apache commons compress
    apache commons codec
    apache commons email
    Http协议介绍
    Java原生Socket API
  • 原文地址:https://www.cnblogs.com/tobetterlife/p/12161618.html
Copyright © 2011-2022 走看看