资源简介
台达PLC modbus通信上位机64位C#实例程序,vs2010亲测可用。台达PLC modbus通信上位机64位C#实例程序,vs2010亲测可用。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32; // for the registry table
using System.Net; // for the ip address
using System.Runtime.InteropServices; // for the P/Invoke
namespace WindowsApplication1
{
public partial class Form1 : Form
{
System.IntPtr hDMTDll; // handle of a loaded DLL
delegate void DelegateClose(int conn_num); // function pointer for disconnection
// About .Net P/Invoke:
// [DllImport(“XXX.dll“ CharSet = CharSet.Auto)]
// static extern int ABC(int a int b);
// indicates that “ABC“ function is imported from XXX.dll
// XXX.dll exports a function of the same name with “ABC“
// the return type and the parameter‘s data type of “ABC“
// must be identical with the function exported from XXX.dll
// and the CharSet = CharSet.Auto causes the CLR
// to use the appropriate character set based on the host OS
[DllImport(“kernel32.dll“ CharSet = CharSet.Auto)]
static extern IntPtr LoadLibrary(string dllPath);
[DllImport(“kernel32.dll“ CharSet = CharSet.Auto)]
static extern bool FreeLibrary(IntPtr hDll);
// Data Access
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern int RequestData(int comm_type int conn_num int slave_addr int func_code byte[] sendbuf int sendlen);
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern int ResponseData(int comm_type int conn_num ref int slave_addr ref int func_code byte[] recvbuf);
// Serial Communication
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern int OpenModbusSerial(int conn_num int baud_rate int data_len char parity int stop_bits int modbus_mode);
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern void CloseSerial(int conn_num);
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern int GetLastSerialErr();
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern void ResetSerialErr();
// Socket Communication
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern int OpenModbusTCPSocket(int conn_num int ipaddr int port);
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern void CloseSocket(int conn_num);
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern int GetLastSocketErr();
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern void ResetSocketErr();
[DllImport(“DMT.dll“ CharSet = CharSet.Auto)]
static extern int ReadSelect(int conn_num int millisecs);
// MODBUS Address Calculation
[DllImpo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-12-06 10:07 Example_C# 2005\
目录 0 2016-12-05 20:14 Example_C# 2005\Backup\
目录 0 2016-12-05 20:14 Example_C# 2005\Backup\WindowsApplication1\
文件 946 2011-04-27 15:55 Example_C# 2005\Backup\WindowsApplication1.sln
文件 39424 2014-06-19 18:26 Example_C# 2005\Backup\WindowsApplication1.suo
文件 19935 2014-06-19 18:26 Example_C# 2005\Backup\WindowsApplication1\Form1.cs
文件 23945 2014-06-19 18:26 Example_C# 2005\Backup\WindowsApplication1\Form1.Designer.cs
文件 5814 2014-06-19 18:26 Example_C# 2005\Backup\WindowsApplication1\Form1.resx
文件 486 2011-04-27 15:55 Example_C# 2005\Backup\WindowsApplication1\Program.cs
目录 0 2016-12-05 20:14 Example_C# 2005\Backup\WindowsApplication1\Properties\
文件 1286 2011-04-27 15:55 Example_C# 2005\Backup\WindowsApplication1\Properties\AssemblyInfo.cs
文件 2867 2011-04-27 15:55 Example_C# 2005\Backup\WindowsApplication1\Properties\Resources.Designer.cs
文件 5612 2011-04-27 15:55 Example_C# 2005\Backup\WindowsApplication1\Properties\Resources.resx
文件 1104 2011-04-27 15:55 Example_C# 2005\Backup\WindowsApplication1\Properties\Settings.Designer.cs
文件 249 2011-04-27 15:55 Example_C# 2005\Backup\WindowsApplication1\Properties\Settings.settings
文件 3295 2011-04-28 19:32 Example_C# 2005\Backup\WindowsApplication1\WindowsApplication1.csproj
文件 168 2012-01-10 16:23 Example_C# 2005\Backup\WindowsApplication1\WindowsApplication1.csproj.user
文件 5685 2016-12-05 20:14 Example_C# 2005\UpgradeLog.xm
目录 0 2016-12-05 20:13 Example_C# 2005\WindowsApplication1\
文件 947 2016-12-05 20:14 Example_C# 2005\WindowsApplication1.sln
文件 49664 2016-12-05 21:01 Example_C# 2005\WindowsApplication1.suo
目录 0 2016-12-05 20:13 Example_C# 2005\WindowsApplication1\bin\
目录 0 2016-12-05 20:14 Example_C# 2005\WindowsApplication1\bin\Debug\
文件 177152 2014-07-16 11:16 Example_C# 2005\WindowsApplication1\bin\Debug\DMT.dll
文件 63062 2014-07-16 11:16 Example_C# 2005\WindowsApplication1\bin\Debug\DMT.lib
文件 23552 2016-12-05 20:33 Example_C# 2005\WindowsApplication1\bin\Debug\WindowsApplication1.exe
文件 44544 2016-12-05 20:33 Example_C# 2005\WindowsApplication1\bin\Debug\WindowsApplication1.pdb
文件 11608 2016-12-05 21:00 Example_C# 2005\WindowsApplication1\bin\Debug\WindowsApplication1.vshost.exe
文件 490 2010-03-17 22:39 Example_C# 2005\WindowsApplication1\bin\Debug\WindowsApplication1.vshost.exe.manifest
文件 151552 2014-04-28 14:30 Example_C# 2005\WindowsApplication1\DMT.dll
文件 19935 2016-12-05 20:33 Example_C# 2005\WindowsApplication1\Form1.cs
............此处省略32个文件信息
相关资源
- csharp版64位含GEOS PROJ
- Modbus通讯协议-C#源码
- NModbus_net-3.5_1.11.0.0-source
- C# 大华SDK开发 64位系统
- C# 开发modbus合集
- Modbus RTU TCP主站从站类库内有说明文档
- NModbusAPI说明文档中文的
- NModbusAPI说明文档中文的 实用
- Oracle.DataAccess 64位/32位 各个版本
- NModbus说明文档API 中文英文+chm
- DELTA DVP Series PLC.zip
- modbus tcp/rtu 基于C#的源码实现(老外的
- 基于C#的台达PLCModus串口通信控件及源
- nmodbus官方例程 包括dllvb.net与C#
- C# 摄像头 时间戳 64位
- C#使用ModbusTcp协议与西门子1200PLC通讯
- C# 海康人脸识别主机demo,64位可运行
- ModBus Tcp 通讯C# +Demo
- C# Asprise OCR 15.3 64位元最新破解(1.去
- C#编成Modbus TCP连接PLC寄存器读取、写
- 水晶报表64位安装包
- Modbus_TCP .net C# 通信
- C#封装modbus
- 基于TCP的 modbus , C#源码
- Modbus RTU c#
- NMODBUS PDF
- C# 2015最新版NMODBUS4.0源码支持TCP/IPRT
- modbus tcp源码(C#)
- 通过MODBUS实现PLC与上位机通讯的C#
- C#ModbusTCP客户端
评论
共有 条评论