⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 visdde.txt

📁 对做的MODBUSRTU的同志很有用,在PC机上模拟对应的MODBUSRTU主机和从机,支持01,02,03,04,05,06,15,16命令,能对通信的质量,错误信息进行显示,经本人试用确实是好东西
💻 TXT
字号:
Visual Basic DDE and Mdbus

The following demonstrates the procedure to obtain coil data from mdbus 
or have mdbus send a coil command in Master Mode or set its internal data 
in Slave Mode.  The DDE section of Mdbus details the DDE procedure for the 
other data types.

1. To obtain Coil Data from Mdbus

Under program control, the following code will bring back coil data from 
coils 1,2 and place the data into textbox text1.  The different coil data 
will be seperated by commas.

text1.linktopic="mdbus|poke"
text1.linkitem="coil 0001 2"
text1.linkmode=2
text1.linkrequest

Alternately, the properties of text1 could be set as follows:

set link topic to mdbus|poke
set linkitem to coil 0001 2
set linkmode to 2

Then under program control, execute the statement text1.linkrequest

2.  To turn a coil on or off with Mdbus

Under program control, the following code will take the data in 
textbox text1 (either 0 or 1) and send it to coil 1.

text1.linktopic="mdbus|poke"
text1.linkitem="coil 0001"
text1.linkmode=2
text1.linkpoke

Alternately, the properties of text1 could be set as follows:

set link topic to mdbus|poke
set linkitem to coil 0001
set linkmode to 2

Then under program control, execute the statement text1.linkpoke

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -