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

c# plc modibus 通信

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

  • 基于CSerialPort的串口多线程框架
    基于CSerialPort的串口多线程通信框架-CSerialPort based on serial communication framework for multi-threaded
    2022-02-21 22:48:22下载
    积分:1
  • ip路由选择
    ip路由选择-ip routing Contents Paragraphs Page
    2022-08-14 10:06:42下载
    积分:1
  • 语音卡开发例子东进
    这个是一个语音卡的开发例子,,,东进的卡,,,实现基本功能,,可作为呼叫中心开心基础。从而进一步深入和扩展
    2022-07-13 20:44:54下载
    积分:1
  • 用MODEM实现来电显示的方法,可以针对任何内置与外置型的MODEM
    用MODEM实现来电显示的方法,可以针对任何内置与外置型的MODEM-with MODEM CND approach to address internal and external to any type of MODEM
    2022-01-26 03:04:17下载
    积分:1
  • Document partition table format, suitable for the realization of a document embe...
    文件分区表格式,适合于嵌入式实现的文件分区表-Document partition table format, suitable for the realization of a document embedded partition table
    2022-08-09 02:14:46下载
    积分:1
  • 清华大学计算机系网络课程 号处理原理 因为太大,所以删了视屏讲解,其它都是全的...
    清华大学计算机系网络课程 信号处理原理 因为太大,所以删了视屏讲解,其它都是全的-Tsinghua University Department of Computer Network Course principles of signal processing because of too great, we have decided to screen on the other are the whole of
    2022-10-02 03:30:03下载
    积分:1
  • 在XWindows下使用打印机界面发送传真
    在XWindows下使用打印机界面发送传真 -Using printer interface to send fax in Xwindows
    2022-03-24 07:51:07下载
    积分:1
  • 自适应滤波引物的源代码
    Source Code for Adaptive Filtering Primer
    2022-02-25 02:50:17下载
    积分:1
  • 0. Install the rp
    0. Install the rp-pppoe-software -------------------------------- You should have already done this by the time you re reading this. If not, go back and read README. 1. Set up your Ethernet hardware -------------------------------- First, make sure the Ethernet card you intend to use with the modem is visible to the Linux kernel. Just how to do this is beyond the scope of this document. However, if the card is the only Ethernet card in the system, executing: ifconfig eth0 should display something like this: eth0 Link encap:Ethernet HWaddr 00:60:67:62:31:D4 plust some more lines. Your HWaddr will be different. As long as you see the HWaddr line, your card should be working. DO NOT assign an IP address to the Ethernet card. DO NOT configure the card to come up at boot time.-0. Install the rp- PPPOE-software-------------------------------- You should have al ready done this by the time you re reading this. I f not, go back and rea
    2023-03-02 00:45:03下载
    积分:1
  • tcp/ip 讯服务器端程序
    tcp/ip 通讯服务器端程序-tcp/ip server communications procedures
    2022-07-16 22:53:48下载
    积分:1
  • 696518资源总数
  • 106161会员总数
  • 5今日下载