回 帖 发 新 帖 刷新版面

主题:[讨论]求助 关于VB 编程实现通讯

一、通讯数据格式为8位数据位、偶校验、1位起始位、1位停止位。
二、通讯协议:遵循标准MODBUS协议,支持03H和10H两个命令: 
查询和修改数据都是长整型的。
三、接收/发送数据格式如下:
1. 查询数据(03H):
计算机发送命令:【设备地址】【命令号】【起始寄存器地址高八位】【低八位】
【读取的寄存器数的高八位】【低八位】【CRC校验的低八位】【CRC校验的高八位】
设备响应:【设备地址】【命令号】【返回的字节个数】【数据1】【数据2】…..【数据n】
【CRC校验的低八位】【CRC校验的高八位】
查询AD命令:01 03 00 00 00 08 crcl crch
2. 修改数据命令(10H):
计算机发送命令:【设备地址】【命令号】【起始寄存器地址高八位】【低八位】【修改的寄
存器数的高八位】【低八位】【修改数据的字节数】【修改的数据1】【修改的数据1】【修改的数据1】【修改的数据1】…..【修改的数据n】【CRC校验的低八位】【CRC校验的高八位】
设备响应:【设备地址】【命令号】【起始寄存器地址高八位】【低八位】【修改的寄存器数的高八位】【低八位】【CRC校验的低八位】【CRC校验的高八位】  
四、仪表功能标定命令见下表:
名称    寄存器地址
(十六进制 H)    修改数据
(十六进制 H)    说明
标定准备    0036    01    上位机发送标定准备命令。
链码标定    0036    02    上位机发送链码标定命令。
实物标定    0036    03    上位机发送实物标定命令。
输入重量    003A    输入实际重量    实物标定功能中输入实际重量值
标定功能中按键操作键下表:
名称    寄存器地址
(十六进制 H)    修改数据
(十六进制 H)    说明
开始/确认    0038    01    开始标定功能/确认速度系数、总系数
退出功能    0038    02    退出标定功能。
五、参数
参数号    寄存器地址(十进制)    参数名称    范围    初值    单位    小数点
1    2    瞬时流量            根据参数37设定    根据参数38设定
2    4    显示累计    0~99999    0    t    3
3    6    皮带速度             m/s    4
4    8    AD                
5*        通讯速率    1~4  
1=4800     2=9600
3=19200  4=38400        t    
6    12    流量平滑    1~50    20        0
7    14    滤波深度    1~90     30        0
8    16    流量单位    1~3
1=t/h 2=kg/h   3=kg/s    1        0
9    18    流量小数    0~4    2        0
10    20    累计小数    0~3    3        0
11    22    标定小数    0~4    3        0
12    24    测速方式    1~2
1=调速方式
2=恒速方式    1        0
13    26    皮带长度    1~99999    10.000    m    3
14    28    整圈时间    0~65535    60.0    s    1
15    30    标定圈数    1~20    3        0
16    32    链码重量    1~99999    15.00    Kg/m    2
17    34    总系高位    0~9999    20        0
19    38    总系低位    0~99999    0        0
20    40    零点AD    5000~50000    5000        0
21    42    总系数    0~99999999    200000    0    0
22    44    速度系数    0~99999    10000    0    0
25    50    基本脉冲    0~99999    1000    0    0
26    52    流量死区    0~10000    0    根据“流量单位”设定    根据“流量小数”设定
27    54    总累计    0~99999    0    t    3
28    56    系统状态    0~1
0-备妥
1-标定    0    0    0
29    58    通讯标定圈数返回                
30    60    通讯标定状态    0~2
1-标定准备完成
2-链码、实物标定完成
3-链码、实物整圈返回    0    0    0

让我根据协议编写一个小的通讯程序  给了一个硬件设施

回复列表 (共2个回复)

沙发

你的设备好像是一台电子皮带秤。

板凳

Russian President Dmitry Medvedev on Sunday [url=http://www.soccercleatsonlines.com/adidas-soccer-cleats-adidas-adipower-predator-trx-fg-c-1_29.html]adidas Adipower predator[/url] ordered an investigation into the allegations of electoral fraud during last weeks parliamentary vote. The announcement came a day after tens of thousands of people rallied in Moscow and other cities to demand the December 4 polls [url=http://www.cheaptimberlandswholesale.com/]cheap timberlands[/url] won by Prime Minister Vladimir Putins ruling United Russia party be annulled and rerun. In a post on the social media site Facebook, Mr. Medvedev said that although he does not agree with any slogans or speeches made at the rallies, he has given [url=http://www.soccercleatcheap.com/]cheap soccer cleats[/url] instructions to check all information from polling station regarding compliance with the election laws. Within minutes of his statement, Mr. Medvedev had received over 1,000 comments on his Facebook site, most of them angry and some [url=http://www.timberlandoutletonline.com/]timberland outlet online[/url] disrespectful. The Occupy London protest site reached its 60th day Monday, running longer than its counterpart in New York did before it was dismantled. It now occupies three sites across the City of London - a cathedral courtyard, a square [url=http://www.soccercleatsonlines.com/adidas-soccer-cleats-adidas-f50-adizero-micoach-fg-c-1_9.html]adidas adizero f50[/url] and a building. One of the sites even has an art gallery. But with growth has come rivalry between the two, with criticism that some American protesters who have decamped to London from New York are too reliant on their creature [url=http://www.cheaptimberlandswholesale.com/mens-timberland-roll-top-boots-c-3.html]timberland boots on sale[/url] comforts. The U.S. economy has recently showed signs of improvement with the unemployment rate dropping from nine percent to 8.6 percent but it remains far above a normal traditional rate of four or five percent. The jobless rate [url=http://www.soccercleatcheap.com/nike-mercurial-glide-iii-ag-green-black-p-289.html]nike mercurial green[/url] is seen as a major factor in whether Mr. Obama can win re-election to another four-year term next November. The president once again called on Congress to approve his nominee, Richard Cordray, to head a new consumer [url=http://www.timberlandoutletonline.com/mens-timberland-roll-top-boots-wheat-p-50.html]timberland roll top boots[/url] protection agency. U.S. President Barack Obama is pressing Republicans in Congress to approve his nominee Richard Cordray to head the first ever consumer guardian agency. During his weekly address Saturday, Obama urged lawmakers to give [url=http://www.soccercleatsonlines.com/nike-soccer-cleats-nike-mercurial-vapor-viii-fg-c-41_64.html]nike mercurial vapor fg[/url] Americans the protection they need from being taken advantage of by mortgage lenders, payday lenders and debt collectors. The president says many people on Wall Street have made a lot money taking advantage of consumers. He is appealing [url=http://www.cheaptimberlandswholesale.com/]timberland for sale[/url] to legislators to give Americans an advocate he says will protect them from unscrupulous practices. Protesters came out across the worlds largest country to demand clean elections and to say what, only one week ago, [url=http://www.soccercleatcheap.com/nike-soccer-cleats-nike-mercurial-victory-iv-ag-c-41_73.html]nike mercurial victory iv[/url] was unsayable. Russia Without Putin was the favorite chant of thousands of demonstrators who marched within earshot of the Kremlin in the largest pro-democracy demonstration since Vladimir Putin came to power in 2000. From Vladivostok on the Pacific [url=http://www.timberlandoutletonline.com/mens-timberland-6-inch-premium-boots-olive-green-p-112.html]timberland boots for men[/url] Coast to Kaliningrad on the Baltic.CF

我来回复

您尚未登录,请登录后再回复。点此登录或注册