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

c# plc modibus 通信

于 2022-07-10 发布 文件大小:11.75 kB
0 176
下载积分: 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 个回复

  • test with the community and the application is very good in use
    测试用的端口通讯程序。有点土,但好用得很呢。你就好好看看吧。关键是用dll做的。-test with the community and the application is very good in use
    2023-07-24 09:15:03下载
    积分:1
  • 高速字符串处理功能的 C 语言源程序,经修改后可以移植到其他程序中?...
    高速字符串处理功能的 C 语言源程序,经修改后可以移植到其他程序中?-string-handling functions of the C language source code, as amended, can be transferred to other procedures?
    2022-02-26 21:33:43下载
    积分:1
  • Comunicacion serial con la computadora para el PIC.
    Comunicacion serial con la computadora para el PIC.
    2022-01-29 02:08:25下载
    积分:1
  • 利用DFT的卷积性质求两个复序列的线性卷积。
    利用DFT的卷积性质求两个复序列的线性卷积。-DFT using the convolution nature for two complex sequence of linear convolution.
    2022-01-25 18:19:19下载
    积分:1
  • Introduction of the QAM modulation constellation diagram for QAM modulation of l...
    介绍了QAM调制的星座图,对于学习QAM调制的有一定的指导意义。-Introduction of the QAM modulation constellation diagram for QAM modulation of learning have a certain significance.
    2022-05-21 16:10:40下载
    积分:1
  • GA算法,在MATLAB上的实现,是源程序
    GA算法,在MATLAB上的实现,是源程序-GA algorithm, the realization in MATLAB is the source
    2022-06-21 11:55:15下载
    积分:1
  • 认知无线电网络
    应用背景最近,认知无线电技术已经被提出作为未来的无线通信的关键技术利用动态频谱接入策略的通信。这提供了更灵活的方式利用无线基于固定频谱接入策略的频谱比传统无线电技术。认知无线电网络(CRNs),获得信道频谱空洞的信息,谈判的主用户和次之间用户对频谱分配、同步传输参数是铬介质访问的重要功能控制协议。在本文中,我们讨论了MAC层的基本职责和CRN的功能。基本上,我们专注于调查的最新进展,在铬麦克协议,以及它们的特点特点,优点和缺点。最后,我们提供了这些协议以表格形式的主要特点。关键技术认知无线电中的动态频谱接入网络仍处于起步阶段。许多重要的和复杂问题需要解决。在本文中,我们提供了一个调查,一些铬麦克协议并讨论了它们的主要工作原理结合自身特点。
    2022-08-21 09:57:21下载
    积分:1
  • winzip的源程序
    winzip的源程序-winzip source
    2022-08-24 22:58:16下载
    积分:1
  • 串口讯源代码,使用方便!
    串口通信的源代码,很好用!-serial communication source code, easy to use!
    2022-02-18 17:23:42下载
    积分:1
  • Symbian S60演示了如何创建功能
    Symbian S60 演示了如何制作多功能的编辑框-Symbian S60 demonstrated how to create feature-rich edit box
    2023-03-10 01:35:05下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载