首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏科控自动化

    [C#]通讯库推荐NModbus4

    起始地址(16位) ushort startAddress 读取数量(16位) ushort numberOfPoints bool[] 02 ReadHoldingRegisters 读取AO的值 从站地址(8位) byte slaveAddress 起始地址(16位) ushort startAddress 读取数量(16位) ushort numberOfPoints ushort[] 03 ReadInputRegisters 读取AI的值 从站地址(8 位) byte slaveAddress 起始地址(16位) ushort startAddress 读取数量(16位) ushort numberOfPoints ushort[] 04 WriteSingleCoil 写入值到DO 从站地址(8位) byte slaveAddress 读起始地址(16位) ushort startReadAddress 读取数量(16位) ushort numberOfPointsToRead, 写入起始地址(16位) ushort

    6K20编辑于 2022-03-29
  • 来自专栏Script Boy (CN-SIMO)

    BypassUAC

    const *,ushort const *,ushort const *,int) 05 SetRasEntryProperties(ushort const *,ushort const *,ushort * *,ulong) 06 DeleteRasEntry(ushort const *,ushort const *) 07 LaunchInfSection(ushort const *,ushort (int,ushort const *,ushort const *,ushort const *) 12 DeleteRegistryStringValue(int,ushort const *,ushort const *,ushort const *,ushort const *,ushort const *,ulong *) 20 RunCustomActionExe(ushort const *,ushort const *,ushort * *) 21 SetRasSubEntryProperties(ushort const *,ushort const *,ulong,ushort * *,ulong

    2.7K30发布于 2020-05-05
  • 来自专栏C#

    C#实现Modbus RTU主站通信(一)

    )modbusMaster.DataLength); UpdateDataShow<ushort>(registers?. )modbusMaster.DataLength); UpdateDataShow<ushort>(registers?. StartAddress { get; set; } = 0; public ushort DataLength { get; set; } = 1; public ushort WriteStartAddress []> ReadHoldingRegistersAsync(byte slaveId, ushort startAddress, ushort numberOfPoints) { try []> ReadInputRegistersAsync(byte slaveId, ushort startAddress, ushort numberOfPoints) { try

    2.1K22编辑于 2025-05-07
  • C/C++ 原生套接字抓取FTP数据包

    ipLength; // 封包总长度,即整个IP报的长度 USHORT ipID; // 封包标识,惟一标识发送的每一个数据报 USHORT 下面是TCP头的结构: typedef struct _TCPHeader { USHORT sourcePort; // 16位源端口号 USHORT destinationPort windows; // 16位窗口大小 USHORT checksum; // 16位校验和 USHORT urgentPointer; windows; // 16位窗口大小 USHORT checksum; // 16位校验和 USHORT urgentPointer; // 16位紧急数据偏移量 destinationPort;// 目的端口号 USHORT len; // 封包长度 USHORT checksum; // 校验和 }

    73010编辑于 2023-12-05
  • C++ 实现的Ping类的封装

    m_usTotalLen; // 总长度 USHORT m_usID; // 标识 USHORT m_usFlagFragOffset; // 3位标志 +13位片偏移 BYTE m_byTTL; // TTL BYTE m_byProtocol; // 协议 USHORT m_usHChecksum m_usChecksum; // 检验和 USHORT m_usID; // 标识符 USHORT m_usSeq; // 序号 ULONG m_ulTimeStamp; // 时间戳(非标准ICMP头部) }; struct PingReply { USHORT m_usSeq; // 来源IP CalCheckSum 函数 USHORT CPing::CalCheckSum(USHORT *pBuffer, int nSize) { unsigned long ulCheckSum = 0

    86910编辑于 2023-12-06
  • 来自专栏xingoo, 一个梦想做发明家的程序员

    网络嗅探器

    ipLength; // 封包总长度,即整个IP报的长度 USHORT ipID; // 封包标识,惟一标识发送的每一个数据报 USHORT windows; // 16位窗口大小 USHORT checksum; // 16位校验和 USHORT urgentPointer ; // 16位紧急数据偏移量 } TCPHeader, *PTCPHeader; typedef struct _UDPHeader { USHORT sourcePort; // 源端口号 USHORT destinationPort;// 目的端口号 USHORT len; // 封包长度 USHORT checksum; // 校验和 } UDPHeader, *PUDPHeader; #endif

    2.4K100发布于 2018-01-17
  • 来自专栏跟着阿笨一起玩NET

    C# 同步工作站与SQL服务器的时间,设置本机时间

    sysTime);        [StructLayout(LayoutKind.Sequential)]    public struct SystemTime    {       public ushort  wYear;       public ushort wMonth;       public ushort wDayOfWeek;       public ushort wDay;       public  ushort wHour;       public ushort wMinute;       public ushort wSecond;       public ushort wMiliseconds

    1.4K20发布于 2018-09-18
  • 来自专栏林德熙的博客

    读 WPF 源代码 了解获取 GlyphTypeface 的 CharacterToGlyphMap 的数量耗时原因

    GlyphTypeface 表示字体的字形信息,通过 GlyphTypeface.CharacterToGlyphMap 属性可以将给定的字符映射到字形索引,这个属性是一个 IDictionary<int, ushort public IDictionary<int, ushort> CharacterToGlyphMap { get { 类型的 _cmap 字段,看到这里,似乎非常清真 继续看看 IntMap 类型的实现 internal sealed class IntMap : IDictionary<int, ushort == null) { _cmap = new Dictionary<int, ushort >(); ushort glyphIndex; for (int codePoint

    14310编辑于 2025-09-27
  • 来自专栏有趣的django

    一、保护模式

    //0x4a USHORT Cs; //0x4c USHORT //0x50 USHORT Reserved4; //0x52 USHORT //0x56 USHORT Fs; //0x58 USHORT //0x5c USHORT Reserved7; //0x5e USHORT //0x62 USHORT Flags; //0x64 USHORT

    1.6K20编辑于 2022-09-21
  • 来自专栏xingoo, 一个梦想做发明家的程序员

    ping 实现设计---ICMP

    下面是checksum的计算校验和的代码: USHORT checksum(USHORT* buff, int size) { unsigned long cksum = 0; while (size>1) { cksum += *buff++; size -= sizeof(USHORT); } // 是奇数 if(size 然后取反 cksum = (cksum >> 16) + (cksum & 0xffff); cksum += (cksum >> 16); return (USHORT , BOOL bRecv = TRUE); USHORT checksum(USHORT* buff, int size) { unsigned long cksum = 0; while (size>1) { cksum += *buff++; size -= sizeof(USHORT); } // 是奇数 if(size

    1.6K70发布于 2018-01-17
  • 来自专栏软件工程师Michael

    C# 实现 Modbus 通信Demo

    读取从站设备的寄存器 ushort startAddress = 0; // 寄存器起始地址 ushort numRegisters = 10; // 读取 10 个寄存器 try { // 读取保持寄存器 ushort[] registers = modbusTcpMaster.ReadHoldingRegisters 读取从站设备的寄存器 ushort startAddress = 0; // 寄存器起始地址 ushort numRegisters = 10; // 读取 10 个寄存器 try { // 读取保持寄存器(从站地址为 1) ushort[] registers = modbusRtuMaster.ReadHoldingRegisters

    1.3K10编辑于 2025-08-22
  • 来自专栏人工智能

    三菱FX5U PLC与C#通信开发指南

    startAddress, ushort pointCount) { byte[] command = new byte[21]; // 副标题 pointCount = (ushort)(data.Length / 2); byte[] pointBytes = BitConverter.GetBytes(pointCount startAddress, ushort pointCount) { if (! startAddr = sortedAddresses[rangeStart].Value; ushort count = (ushort)(rangeEnd - rangeStart startAddress, ushort pointCount) { while (!

    18710编辑于 2026-01-21
  • 来自专栏全栈程序员必看

    DeviceIOControl实战「建议收藏」

    wGenConfig; // WORD 0: 基本信息字 USHORT wNumCyls; // WORD 1: 柱面数 USHORT wReserved2; // WORD 2: 保留 USHORT USHORT DMA:1; // 1=支持DMA USHORT LBA:1; // 1=支持LBA USHORT DisIORDY:1; // 1=可不使用IORDY USHORT IORDY:1; USHORT wPIOTiming; // WORD 51: PIO时序 USHORT wDMATiming; // WORD 52: DMA时序 struct { USHORT CHSNumber:1 ; // 1=WORD 54-58有效 USHORT CycleNumber:1; // 1=WORD 64-70有效 USHORT UnltraDMA:1; // 1=WORD 88有效 USHORT USHORT Mode0Sel:1; // 1=已选择模式0 USHORT Mode1Sel:1; // 1=已选择模式1 USHORT Mode2Sel:1; // 1=已选择模式2 USHORT Mode3Sel

    2.6K41编辑于 2022-10-04
  • 来自专栏AIoT技术交流、分享

    Modbus RTU 、Modbus ASCII及Modbus TCP驱动代码,支持主机和从机两种模式

    USHORT * pusDataBuffer, LONG lTimeOut ) usReadRegAddr, USHORT usNReadRegs, USHORT usWriteRegAddr, USHORT usNWriteRegs eMBMasterReqReadInputRegister( UCHAR ucSndAddr, USHORT eMBMasterReqWriteMultipleCoils( UCHAR ucSndAddr, USHORT

    1.6K20编辑于 2023-07-13
  • 来自专栏林德熙的博客

    WPF 修改屏幕亮度

    value = (double) brightness / 100; RAMP ramp = default(RAMP); ramp.Red = new ushort [256]; ramp.Green = new ushort[256]; ramp.Blue = new ushort[256]; ramp.Red[i] = ramp.Green[i] = ramp.Blue[i] = Math.Max(ushort.MinValue, Math.Min(ushort.MaxValue, tmp) [256]; ramp.Green = new ushort[256]; ramp.Blue = new ushort[256]; ramp.Red[i] = ramp.Green[i] = ramp.Blue[i] = Math.Max(ushort.MinValue, Math.Min(ushort.MaxValue, tmp)

    1.3K10发布于 2020-07-07
  • 来自专栏xingoo, 一个梦想做发明家的程序员

    原始UDP封包发送

    ->len); chksumlen += sizeof(pUdphdr->len); // 16位的UDP校验和,置为0 memcpy(ptr, &zero, sizeof(USHORT )); ptr += sizeof(USHORT); chksumlen += sizeof(USHORT); // 净荷 memcpy(ptr, payload, payloadlen ptr++; chksumlen++; } // 计算这个校验和,将结果填充到UDP头 pUdphdr->checksum = checksum((USHORT nDestPort = 4567; USHORT nSourcePort = 8888; char szMsg[] = "This is a test \r\n"; int nMsgLen (szSourceIp); pIphdr->ipDestination = ::inet_addr(szDestIp); pIphdr->ipChecksum = checksum((USHORT

    2.2K60发布于 2018-01-17
  • 来自专栏centosDai

    实现MyXLS设置行高的功能

    12345678910 private ushort _rowHeight; ///

    /// Gets the row index of this Row object./// public ushort RowHeight{get { return _rowHeight; }set { _rowHeight = value; }} 2、RowBlocks.cs 在生成字节时  _rowHeight;private ushort _rowIdxStart = 0;private ushort _rowIdxEnd = 0; /// /// Gets or sets height of the rows./// public ushort RowHeight{get { return _rowHeight; }set { _rowHeight = value; }} /// /// Gets or sets index to first row in the range./// public ushort

    1500编辑于 2021-12-08
  • 来自专栏kayden

    原始套接字和流量嗅探

    ), #ip数据包总长度 ("id", c_ushort), #标识符 ("offset", c_ushort ), ("id", c_ushort), ("offset", c_ushort), ("ttl", c_ubyte), ("protocol_num ), #ip数据包总长度 ("id", c_ushort), #标识符 ("offset", c_ushort ), ("id", c_ushort), ("offset", c_ushort), ("ttl", c_ubyte), ("protocol_num ), #ip数据包总长度 ("id", c_ushort), #标识符 ("offset", c_ushort

    2.3K20编辑于 2022-09-29
  • Python 抓取并解码原始数据包

    ), ("id", c_ushort), ("offset", c_ushort), ("ttl", c_ubyte), ("protocol_num", c_ubyte), ("sum", c_ushort), ("src", ), ("id", c_ushort), ("offset", c_ushort), ("ttl", c_ubyte), ("protocol_num", c_ubyte), ("sum", c_ushort), ("src", ), ("unused", c_ushort), ("next_hop_mtu", c_ushort) ] def __new_

    1.2K40编辑于 2022-12-28
  • 来自专栏好奇心Log

    X波段双极化相控阵天气雷达基数据的python读取方法

    ', USHORT), # 仰角数 ('SequenceNumber', USHORT), # 当前方位角内,仰角编号 从0开始 ( 'StartGateRange', USHORT), # 起始库距离 米 ('UnitGateLength', USHORT), # 单位库距离 米 +体扫模式) ('RefdBT', USHORT), # 数据回放指针:原始反射率因子 ('RefdBZ', USHORT), USHORT), # 数据回放指针:谱宽 ('RefZDR', USHORT), # 数据回放指针:差分反射率因子 (' RefPhiDP', USHORT), # 数据回放指针:差分相位 ('RefKDP', USHORT), # 数据回放指针:比差分相位

    4.3K40发布于 2021-11-10
领券