登录
首页 » 通信 » c# plc modibus 通信

c# plc modibus 通信

于 2022-07-10 发布 文件大小:11.75 kB
0 175
下载积分: 2 下载次数: 1

代码说明:

c# 串口 以太网通信 modibus  连接 plc  从文本框输入负数 -2 补码=反+1=进位+原数 Vb 清除输入缓冲区 输出缓冲区 c#用不用清除??哪个函数?? //發送二進制數據 ?????????????? private void SendBytesData(SerialPort serialPort) { ////从 文本框取得数据 如果负数 -2 怎么办???? byte[] bytesSend = Encoding.Default.GetBytes(txtSend.Text); spcom.Write(bytesSend, 0, bytesSend.Length); } 通过MODBUS TCP读写PLC源码 功能模块一:读写PLC主模块 using System; using System.Net; using System.Net.Sockets; public static void WriteWord(int mwAddress,int mwValue) {写字到以太网 if (init_plc() == 0) { try { hi = mwAddress / 256; low = mwAddress - hi * 256; hi1 = mwValue / 256; ///////////16bit low1 = mwValue - hi * 256; sendBuf[7] = 6; sendBuf[8] = (byte)hi; sendBuf[9] = (byte)low; sendBuf[10]

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • as-gps 包含基本的对访问廉价的Aisin-Seiki GPS 模块的支持,这一功能以前在mavin.com上是可用的。这个包也包括了几个简单的控制台工具来转储卫星状态,位置,和时间,并可同步化系统时钟。-as-a GPS contains the basic right to visit cheap Aisin- Seiki GPS module support this feature before in mavin.com is available. The package also includes a console a few simple tools to dump satellite state, location, and time and can synchronize the system clock.
    2023-04-16 13:30:03下载
    积分:1
  • 这是用BCB 编写的HID测试程序,自动检测HID设备
    这是用BCB 编写的HID测试程序,自动检测HID设备-It is written with the BCB test program HID, HID auto-detection equipment
    2023-02-09 18:40:04下载
    积分:1
  • MMSN最早的针对无线传感器网络的固定道分配的多道MAC协议...
    MMSN最早的针对无线传感器网络的固定信道分配的多信道MAC协议-MMSN the first wireless sensor network for the fixed channel assignment of multi-channel MAC protocol
    2022-07-01 17:18:27下载
    积分:1
  • LTE链路仿真
    该程序是LTE链路层仿真程序,包含许多模块,参考信号生成、信道估计等。该程序对于正在做LTE相关方面研究的同学,具有很好的参考价值,你可以根据你所研究的方向,可以在上面做修改,实现相应的功能。非常好的一个程序!
    2022-04-16 18:29:15下载
    积分:1
  • 这是生成两个随机数的程序,分别服从均匀分布和正态分布
    这是生成两个随机数的程序,分别服从均匀分布和正态分布-This is a random number to generate the two procedures, respectively, subject to uniform distribution and normal distribution
    2022-08-11 02:14:18下载
    积分:1
  • RFC1073 Telnet window size options (RFC1073 Telnet Window Size Option
    RFC1073 Telnet窗口大小选项(RFC1073 Telnet窗口大小选项
    2022-02-15 12:45:58下载
    积分:1
  • gauss_generator使用参数(多普勒频移系数,相移…
    Gauss_generator利用参数(多普勒频移、系数、相移)生成确定的实高斯过程.m gaussian确定离散多普勒频移、系数、相移的程序.m Rice_generator在瑞利过程的基础上考虑视距分量,生成莱斯过程.m Suzuki_generator成确定型Suzuki过程.m Rayleigh_Doppler_multiPath.m Rayleigh_Doppler_singlePath.m rayleigh_Filter_Model.m pdf_cdf_gen.m test_rayleigh_pdf.m rayleigh.m-Gauss_generator use parameters (Doppler frequency shift coefficient, phase shift) formation to determine the actual Gaussian process. m Gaussian identify discrete Doppler frequency shift coefficient, Phase-shifting procedures. m Rice_generator in Rayleigh process on the basis of weight to consider the horizon, Rice production process. m-Suzuki_generator identified as Suzuki process. m Ra yleigh_Doppler_multiPath.m Rayleigh_Doppl er_singlePath.m rayleigh_Filter_Model.m pd f_cdf_gen.m test_rayleigh_pdf.m rayleigh.m
    2022-05-30 15:11:08下载
    积分:1
  • freescale公司的SPI总线规范,非常详细,研究串行总线的朋友值得一看...
    freescale公司的SPI总线规范,非常详细,研究串行总线的朋友值得一看-Freescale
    2023-09-04 00:10:03下载
    积分:1
  • 中文RFC文档,不用翻译,对学习很有帮助!
    中文RFC文件,无需翻译,对学习很有帮助!
    2022-02-10 03:21:38下载
    积分:1
  • 射频和微波电路
    无线技术日益巨大,与新的应用程序。在传统的应用程序,旁边射频和微波正在使用蜂窝通信,当地区域网络。
    2022-03-20 15:49:41下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载